mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 07:31:37 +08:00
Download nuget.exe in a version-including subfolder in Downloads\
This commit is contained in:
parent
ccda20a858
commit
d5e7a501e9
@ -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
|
||||
|
@ -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};
|
||||
|
Loading…
Reference in New Issue
Block a user