mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
Merge branch 'master' of https://github.com/Microsoft/vcpkg
This commit is contained in:
commit
1e3435e32b
@ -190,10 +190,10 @@ function vcpkgInvokeCommandClean()
|
||||
Write-Verbose "Clean-Executing: ${executable} ${arguments}"
|
||||
$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition
|
||||
$cleanEnvScript = "$scriptsDir\VcpkgPowershellUtils-ClearEnvironment.ps1"
|
||||
$command = "& `"$cleanEnvScript`"; & `"$executable`" $arguments"
|
||||
$bytes = [System.Text.Encoding]::Unicode.GetBytes($command)
|
||||
$encodedCommand = [Convert]::ToBase64String($bytes)
|
||||
$arg = "-NoProfile -ExecutionPolicy Bypass -encodedCommand $encodedCommand"
|
||||
$tripleQuotes = "`"`"`""
|
||||
$argumentsWithEscapedQuotes = $arguments -replace "`"", $tripleQuotes
|
||||
$command = ". $tripleQuotes$cleanEnvScript$tripleQuotes; & $tripleQuotes$executable$tripleQuotes $argumentsWithEscapedQuotes"
|
||||
$arg = "-NoProfile", "-ExecutionPolicy Bypass", "-command $command"
|
||||
|
||||
$process = Start-Process -FilePath powershell.exe -ArgumentList $arg -PassThru -NoNewWindow
|
||||
Wait-Process -InputObject $process
|
||||
@ -226,3 +226,23 @@ function vcpkgFormatElapsedTime([TimeSpan]$ts)
|
||||
|
||||
throw $ts
|
||||
}
|
||||
|
||||
function vcpkgFindFileRecursivelyUp()
|
||||
{
|
||||
param(
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Parameter(Mandatory=$true)][string]$startingDir,
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Parameter(Mandatory=$true)][string]$filename
|
||||
)
|
||||
|
||||
$currentDir = $startingDir
|
||||
|
||||
while (!($currentDir -eq "") -and !(Test-Path "$currentDir\$filename"))
|
||||
{
|
||||
Write-Verbose "Examining $currentDir for $filename"
|
||||
$currentDir = Split-path $currentDir -Parent
|
||||
}
|
||||
Write-Verbose "Examining $currentDir for $filename - Found"
|
||||
return $currentDir
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ param(
|
||||
|
||||
$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition
|
||||
. "$scriptsDir\VcpkgPowershellUtils.ps1"
|
||||
$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root
|
||||
$vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root
|
||||
Write-Verbose("vcpkg Path " + $vcpkgRootDir)
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@ $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition
|
||||
. "$scriptsDir\VcpkgPowershellUtils.ps1"
|
||||
|
||||
Write-Verbose "Fetching dependency: $Dependency"
|
||||
$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root
|
||||
$vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root
|
||||
|
||||
$downloadsDir = "$vcpkgRootDir\downloads"
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Parameter(Mandatory=$true)][string]$startingDir,
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Parameter(Mandatory=$true)][string]$filename
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$currentDir = $startingDir
|
||||
|
||||
while (!($currentDir -eq "") -and !(Test-Path "$currentDir\$filename"))
|
||||
{
|
||||
Write-Verbose "Examining $currentDir for $filename"
|
||||
$currentDir = Split-path $currentDir -Parent
|
||||
}
|
||||
Write-Verbose "Examining $currentDir for $filename - Found"
|
||||
return $currentDir
|
@ -16,7 +16,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{F589
|
||||
..\scripts\bootstrap.ps1 = ..\scripts\bootstrap.ps1
|
||||
..\scripts\fetchDependency.ps1 = ..\scripts\fetchDependency.ps1
|
||||
..\scripts\findAnyMSBuildWithCppPlatformToolset.ps1 = ..\scripts\findAnyMSBuildWithCppPlatformToolset.ps1
|
||||
..\scripts\findFileRecursivelyUp.ps1 = ..\scripts\findFileRecursivelyUp.ps1
|
||||
..\scripts\findVisualStudioInstallationInstances.ps1 = ..\scripts\findVisualStudioInstallationInstances.ps1
|
||||
..\scripts\get_triplet_environment.cmake = ..\scripts\get_triplet_environment.cmake
|
||||
..\scripts\getProgramFiles32bit.ps1 = ..\scripts\getProgramFiles32bit.ps1
|
||||
|
Loading…
x
Reference in New Issue
Block a user