Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Referencing of multiple files from same repository directory #445

Merged
merged 2 commits into from
Dec 9, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/Paket.Core/RemoteDownload.fs
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,17 @@ let DownloadSourceFile(rootPath, source:ModuleResolver.ResolvedSourceFile) =
let destination = Path.Combine(rootPath, source.FilePath)

let isInRightVersion =
if not <| versionFile.Exists then false
else source.Commit = File.ReadAllText(versionFile.FullName)
versionFile.Exists && File.Exists destination &&
source.Commit = File.ReadAllText(versionFile.FullName)

if isInRightVersion then
verbosefn "Sourcefile %s is already there." (source.ToString())
else
tracefn "Downloading %s to %s" (source.ToString()) destination

CleanDir (destination |> Path.GetDirectoryName)
destination |> Path.GetDirectoryName |> CleanDir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work as CleanDir removes the directory with all the already downloaded files.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahj this would explain #442

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's the cause of it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about e7e3a43 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better, but if someone reference multiple files from different branches, so version would differ and the behavior is not predictable and we would still get access errors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That's true I don't have a good solution right now. Maybe you see a better way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided better handling with #451


do! downloadRemoteFiles(source,destination)
File.WriteAllText(versionFile.FullName, source.Commit)
if not (versionFile.Exists && source.Commit = File.ReadAllText(versionFile.FullName)) then
File.WriteAllText(versionFile.FullName, source.Commit)
}