Skip to content

Commit

Permalink
Call restore in rootFolder - references fsprojects#4122
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Feb 17, 2022
1 parent c465670 commit bb4eedd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#### 7.0.0-alpha016 - 2022-12-09
#### 7.0.0-alpha017 - 2022-12-17
* Support as .NET 6.0 tool
* Auto-Restore after paket install an paket update

Expand Down
7 changes: 5 additions & 2 deletions src/Paket.Core/Common/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,10 @@ type PackagesFolderGroupConfig =
parentPath () |> ResolvedPackagesFolder.ResolvedFolder
static member Default = DefaultPackagesFolder

let runDotnet arguments =
let runDotnet workingDir arguments =
let result =
let p = new System.Diagnostics.Process()
p.StartInfo.WorkingDirectory <- workingDir
p.StartInfo.FileName <- "dotnet"
p.StartInfo.Arguments <- arguments
p.Start() |> ignore
Expand All @@ -467,6 +468,8 @@ let RunInLockedAccessMode(lockedFolder,lockedAction: unit -> bool) =
if not (Directory.Exists lockedFolder) then
Directory.CreateDirectory lockedFolder |> ignore

let rootFolder = DirectoryInfo(lockedFolder).Parent

let currentProcess = System.Diagnostics.Process.GetCurrentProcess()
let fileName = Path.Combine(lockedFolder,Constants.AccessLockFileName)
let pid = string currentProcess.Id
Expand Down Expand Up @@ -539,7 +542,7 @@ let RunInLockedAccessMode(lockedFolder,lockedAction: unit -> bool) =
releaseLock 5
if runDotNetRestore then
tracefn "Calling dotnet restore"
runDotnet "restore"
runDotnet rootFolder.FullName "restore"
with
| _ ->
releaseLock 5
Expand Down

0 comments on commit bb4eedd

Please sign in to comment.