Permalink
Browse files

Fix remote download

  • Loading branch information...
forki committed Apr 12, 2016
1 parent bc73939 commit 1c2250ed5fae51a5f086325347fecefe16bba27a
Showing with 8 additions and 4 deletions.
  1. +3 −0 RELEASE_NOTES.md
  2. +5 −4 src/Paket.Core/RemoteDownload.fs
View
@@ -1,3 +1,6 @@
#### 2.58.16 - 12.04.2016
* BUGFIX: Create folder for all source file dependencies
#### 2.58.15 - 12.04.2016
* BUGFIX: Remove process should remove packages from specified groups - https://github.com/fsprojects/Paket/issues/1596
@@ -128,7 +128,11 @@ let rec DirectoryCopy(sourceDirName, destDirName, copySubDirs) =
DirectoryCopy(subdir.FullName, Path.Combine(destDirName, subdir.Name), copySubDirs)
/// Gets a single file from github.
let downloadRemoteFiles(remoteFile:ResolvedSourceFile,destination) = async {
let downloadRemoteFiles(remoteFile:ResolvedSourceFile,destination) = async {
let targetFolder = FileInfo(destination).Directory
if not targetFolder.Exists then
targetFolder.Create()
match remoteFile.Origin, remoteFile.Name with
| SingleSourceFileOrigin.GistLink, Constants.FullProjectSourceFileName ->
let fi = FileInfo(destination)
@@ -172,9 +176,6 @@ let downloadRemoteFiles(remoteFile:ResolvedSourceFile,destination) = async {
| SingleSourceFileOrigin.HttpLink(origin), _ ->
let url = origin + remoteFile.Commit
let authentication = auth remoteFile.AuthKey url
let targetFolder = FileInfo(destination).Directory
if not targetFolder.Exists then
targetFolder.Create()
match Path.GetExtension(destination).ToLowerInvariant() with
| ".zip" ->
do! downloadFromUrl(authentication, url) destination

6 comments on commit 1c2250e

@haraldsteinlechner

This comment has been minimized.

Show comment
Hide comment
@haraldsteinlechner

haraldsteinlechner Apr 12, 2016

Contributor

@forki i'm a little confused by your recent commits. 65e554e broke github downloads. After that there seems to be some commits fixing the issue for specific cases (including this one).
So the question is: should ClearDir recreate the directory or not. If the current implementation is specification we need to change the comment (at least it confused me when tracking down broken github download)

Contributor

haraldsteinlechner replied Apr 12, 2016

@forki i'm a little confused by your recent commits. 65e554e broke github downloads. After that there seems to be some commits fixing the issue for specific cases (including this one).
So the question is: should ClearDir recreate the directory or not. If the current implementation is specification we need to change the comment (at least it confused me when tracking down broken github download)

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Apr 12, 2016

Member

I thought it's not needed to create the dir if it already exists. What did I broke in CleanDir!?

Member

forki replied Apr 12, 2016

I thought it's not needed to create the dir if it already exists. What did I broke in CleanDir!?

@haraldsteinlechner

This comment has been minimized.

Show comment
Hide comment
@haraldsteinlechner

haraldsteinlechner Apr 12, 2016

Contributor

i think RemoteDownload.fs 162-164 cleans the directory and immediately afterwards downloads a zip file into the cleaned dir. in that case downloadFromUrl fails with error message:
Message: One or more errors occurred.
Details: An exception occurred during a WebClient request.
The inner.inner exception unveils directorynotfound exn.

Contributor

haraldsteinlechner replied Apr 12, 2016

i think RemoteDownload.fs 162-164 cleans the directory and immediately afterwards downloads a zip file into the cleaned dir. in that case downloadFromUrl fails with error message:
Message: One or more errors occurred.
Details: An exception occurred during a WebClient request.
The inner.inner exception unveils directorynotfound exn.

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Apr 12, 2016

Member

ah I found the issue. thanks

Member

forki replied Apr 12, 2016

ah I found the issue. thanks

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Apr 12, 2016

Member

How about 3089df6?

Member

forki replied Apr 12, 2016

How about 3089df6?

@haraldsteinlechner

This comment has been minimized.

Show comment
Hide comment
@haraldsteinlechner

haraldsteinlechner Apr 12, 2016

Contributor

works.

Contributor

haraldsteinlechner replied Apr 12, 2016

works.

Please sign in to comment.