Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and Meni Zalzman committed Oct 14, 2015
1 parent 3216726 commit fdbd09f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ await ConcurrencyUtilities.ExecuteWithFileLocked(targetNupkg,
// Now rename the tmp file
File.Move(targetTempNupkg, targetNupkg);

var tempHashPath = Path.Combine(hashPath, Path.GetRandomFileName());

using (var nupkgStream = File.Open(targetNupkg, FileMode.Open, FileAccess.Read, FileShare.Read))
{
string packageHash;
Expand All @@ -122,7 +124,10 @@ await ConcurrencyUtilities.ExecuteWithFileLocked(targetNupkg,

// Note: PackageRepository relies on the hash file being written out as the
// final operation as part of a package install to assume a package was fully installed.
File.WriteAllText(hashPath, packageHash);
File.WriteAllText(tempHashPath, packageHash);

// Rename the tmp hash file
File.Move(tempHashPath, hashPath);
}

log.LogVerbose($"Completed installation of {packageIdentity.Id} {packageIdentity.Version}");
Expand Down

0 comments on commit fdbd09f

Please sign in to comment.