Skip to content

Commit

Permalink
Don't trace download of remote files twice
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jun 29, 2016
1 parent ffb3c8d commit e0b8a5a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* BUGFIX: Using network cache with invalid credentials should not fail restore - https://github.com/fsprojects/Paket/issues/1758
* BUGFIX: Make the copy task more robust if we can't parse target framework - https://github.com/fsprojects/Paket/issues/1756
* USABILITY: Show out-of-sync warning message if paket.lock is not matching paket.dependencies - https://github.com/fsprojects/Paket/issues/1750
* COSMETICS: Don't trace download of remote files twice

#### 3.3.0 - 25.06.2016
* Paket fails on dependencies file that has same package twice in same group - https://github.com/fsprojects/Paket/issues/1757
Expand Down
9 changes: 2 additions & 7 deletions src/Paket.Core/RemoteDownload.fs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ let downloadRemoteFiles(remoteFile:ResolvedSourceFile,destination) = async {

match remoteFile.Origin, remoteFile.Name with
| Origin.GitLink (RemoteGitOrigin cloneUrl), _
| Origin.GitLink (LocalGitOrigin cloneUrl), _ ->
| Origin.GitLink (LocalGitOrigin cloneUrl), _ ->
if not <| Utils.isMatchingPlatform remoteFile.OperatingSystemRestriction then () else
let cloneUrl = cloneUrl.TrimEnd('/')

Expand Down Expand Up @@ -224,7 +224,6 @@ let downloadRemoteFiles(remoteFile:ResolvedSourceFile,destination) = async {
with
| exn -> failwithf "Could not run \"%s\".\r\nError: %s" tCommand exn.Message
| Origin.GistLink, Constants.FullProjectSourceFileName ->
tracefn "Downloading %O to %s" remoteFile destination
let fi = FileInfo(destination)
let projectPath = fi.Directory.FullName

Expand All @@ -242,8 +241,7 @@ let downloadRemoteFiles(remoteFile:ResolvedSourceFile,destination) = async {
}
) |> Async.Parallel
task |> Async.RunSynchronously |> ignore
| Origin.GitHubLink, Constants.FullProjectSourceFileName ->
tracefn "Downloading %O to %s" remoteFile destination
| Origin.GitHubLink, Constants.FullProjectSourceFileName ->
let fi = FileInfo(destination)
let projectPath = fi.Directory.FullName
let zipFile = Path.Combine(projectPath,sprintf "%s.zip" remoteFile.Commit)
Expand All @@ -256,17 +254,14 @@ let downloadRemoteFiles(remoteFile:ResolvedSourceFile,destination) = async {
let source = Path.Combine(projectPath, sprintf "%s-%s" remoteFile.Project remoteFile.Commit)
DirectoryCopy(source,projectPath,true)
| Origin.GistLink, _ ->
tracefn "Downloading %O to %s" remoteFile destination
let downloadUrl = rawGistFileUrl remoteFile.Owner remoteFile.Project remoteFile.Name
let authentication = auth remoteFile.AuthKey downloadUrl
return! downloadFromUrl(authentication, downloadUrl) destination
| Origin.GitHubLink, _ ->
tracefn "Downloading %O to %s" remoteFile destination
let url = rawFileUrl remoteFile.Owner remoteFile.Project remoteFile.Commit remoteFile.Name
let authentication = auth remoteFile.AuthKey url
return! downloadFromUrl(authentication, url) destination
| Origin.HttpLink(origin), _ ->
tracefn "Downloading %O to %s" remoteFile destination
let url = origin + remoteFile.Commit
let authentication = auth remoteFile.AuthKey url
match Path.GetExtension(destination).ToLowerInvariant() with
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<StartWorkingDirectory>D:\code\PaketKopie</StartWorkingDirectory>
<StartArguments>update -f</StartArguments>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001117-aws\temp</StartWorkingDirectory>
<StartArguments>install</StartArguments>
<StartWorkingDirectory>D:\temp\paket</StartWorkingDirectory>
<StartArguments>update</StartArguments>
<StartWorkingDirectory>D:\code\paketkopie</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
Expand Down

0 comments on commit e0b8a5a

Please sign in to comment.