Skip to content

Commit

Permalink
Merge pull request #254 from mexx/fix-243
Browse files Browse the repository at this point in the history
do only delete files which will be downloaded by init-auto-restore process
  • Loading branch information
forki committed Oct 13, 2014
2 parents 7c4952b + cd94e4e commit 9c0df4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Paket.Core/VSIntegration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ open Logging
open System

let InitAutoRestore() =
if not <| Directory.Exists(".paket") then Directory.CreateDirectory(".paket") |> ignore
CleanDir(".paket")
CreateDir(".paket")
use client = createWebClient None

let releasesUrl = "https://api.github.com/repos/fsprojects/Paket/releases";
Expand All @@ -16,6 +15,9 @@ let InitAutoRestore() =
let latestVersion = data.Substring(start, end' - start);

for file in ["paket.targets"; "paket.bootstrapper.exe"] do
try
File.Delete(Path.Combine(".paket", file))
with _ -> traceErrorfn "Unable to delete %s" file
try
client.DownloadFile(sprintf "https://github.com/fsprojects/Paket/releases/download/%s/%s" latestVersion file,
Path.Combine(".paket", file))
Expand Down

0 comments on commit 9c0df4e

Please sign in to comment.