Download nuget.exe in a version-including subfolder in Downloads\

This commit is contained in:
Alexander Karatarakis 2017-01-24 12:30:14 -08:00
parent ccda20a858
commit d5e7a501e9
2 changed files with 10 additions and 3 deletions

View File

@ -133,9 +133,9 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
$requiredVersion = "3.3.0"
$downloadVersion = "3.5.0"
$url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe"
$downloadPath = "$downloadsDir\nuget.exe"
$downloadPath = "$downloadsDir\nuget-3.5.0\nuget.exe"
$expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918"
$executableFromDownload = "$downloadsDir\nuget.exe"
$executableFromDownload = $downloadPath
$extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED
}
elseif($Dependency -eq "git")
@ -155,6 +155,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
throw "Unknown program requested"
}
$downloadSubdir = Split-path $downloadPath -Parent
if (!(Test-Path $downloadSubdir))
{
New-Item -ItemType Directory -Path $downloadSubdir | Out-Null
}
performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion
#calculating the hash

View File

@ -87,7 +87,8 @@ namespace vcpkg::Environment
void ensure_nuget_on_path(const vcpkg_paths& paths)
{
const std::wstring path_buf = Strings::wformat(L"%s;%s", paths.downloads.native(), System::wdupenv_str(L"PATH"));
const fs::path downloaded_nuget = paths.downloads / "nuget-3.5.0";
const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::wdupenv_str(L"PATH"));
_wputenv_s(L"PATH", path_buf.c_str());
static constexpr std::array<int, 3> nuget_version = {3,3,0};