diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-05-19 17:54:50 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-05-19 19:23:32 -0700 |
| commit | a739df905c129eb13d7060419a78f5a693974b63 (patch) | |
| tree | fa0b1431081fc039485d95a591915a829abc8b0d /scripts | |
| parent | 555fa8d7cc25f409fea9626383dfc38c5d5db6b4 (diff) | |
| download | vcpkg-a739df905c129eb13d7060419a78f5a693974b63.tar.gz vcpkg-a739df905c129eb13d7060419a78f5a693974b63.zip | |
Merge VcpkgPowershellUtils into bootstrap.ps1
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/VcpkgPowershellUtils.ps1 | 25 | ||||
| -rw-r--r-- | scripts/bootstrap.ps1 | 27 |
2 files changed, 25 insertions, 27 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 deleted file mode 100644 index 259df4acb..000000000 --- a/scripts/VcpkgPowershellUtils.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) -{ - if ($object -eq $null) - { - return $false - } - - return [bool]($object.psobject.Properties | Where-Object { $_.Name -eq "$propertyName"}) -} - -function getProgramFiles32bit() -{ - $out = ${env:PROGRAMFILES(X86)} - if ($out -eq $null) - { - $out = ${env:PROGRAMFILES} - } - - if ($out -eq $null) - { - throw "Could not find [Program Files 32-bit]" - } - - return $out -}
\ No newline at end of file diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index a2d9103dd..09c138bb3 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -5,10 +5,33 @@ param( ) Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" - $vcpkgRootDir = $scriptsDir $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash +function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) +{ + if ($object -eq $null) + { + return $false + } + + return [bool]($object.psobject.Properties | Where-Object { $_.Name -eq "$propertyName"}) +} + +function getProgramFiles32bit() +{ + $out = ${env:PROGRAMFILES(X86)} + if ($out -eq $null) + { + $out = ${env:PROGRAMFILES} + } + + if ($out -eq $null) + { + throw "Could not find [Program Files 32-bit]" + } + + return $out +} while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) { |
