Skip to content
This repository has been archived by the owner on Sep 26, 2020. It is now read-only.

Commit

Permalink
Paket.Init function replace Copy and fixes #58 (#60)
Browse files Browse the repository at this point in the history
* \#58 replaced Paket.Copy with Paket.Init

* fixing function definition location #58
  • Loading branch information
dangets authored and Krzysztof-Cieslak committed Mar 16, 2017
1 parent ac63b00 commit 3846fdc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 10 additions & 7 deletions src/Forge.Core/Paket.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ let getPaketLocation () =
if Directory.Exists local then local else paketLocation

let getPaket () =
let local = directory </> ".paket" </> "paket.exe"
if File.Exists local then local else paketLocation </> "paket.exe"
getPaketLocation () </> "paket.exe"


let Copy folder =
let copy folder =
folder </> ".paket" |> Directory.CreateDirectory |> ignore
Directory.GetFiles location
|> Seq.iter (fun x ->
let fn = Path.GetFileName x
File.Copy (x, folder </> ".paket" </> fn, true) )
let filename = Path.GetFileName x
File.Copy (x, folder </> ".paket" </> filename, true) )


let Update () =
let f = getPaketLocation ()
Expand All @@ -30,5 +29,9 @@ let Run args =
let args' = args |> String.concat " "
run f args' directory


let Init folder =
if Directory.GetFiles folder |> Seq.exists (fun n -> n.EndsWith "paket.dependencies") |> not then
copy folder
Update ()
Run ["init"]

4 changes: 1 addition & 3 deletions src/Forge.Core/Templates.fs
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ module Project =
sed "<%= paketPath %>" (relative directory) projectFolder
sed "<%= packagesPath %>" (relative packagesDirectory) projectFolder

Paket.Copy directory
if Directory.GetFiles directory |> Seq.exists (fun n -> n.EndsWith "paket.dependencies") |> not then
Paket.Run ["init"]
Paket.Init directory

Directory.GetFiles projectFolder
|> Seq.tryFind (fun n -> n.EndsWith "paket.references")
Expand Down

0 comments on commit 3846fdc

Please sign in to comment.