aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2018-05-19 17:54:50 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2018-05-19 19:23:32 -0700
commita739df905c129eb13d7060419a78f5a693974b63 (patch)
treefa0b1431081fc039485d95a591915a829abc8b0d
parent555fa8d7cc25f409fea9626383dfc38c5d5db6b4 (diff)
downloadvcpkg-a739df905c129eb13d7060419a78f5a693974b63.tar.gz
vcpkg-a739df905c129eb13d7060419a78f5a693974b63.zip
Merge VcpkgPowershellUtils into bootstrap.ps1
-rw-r--r--scripts/VcpkgPowershellUtils.ps125
-rw-r--r--scripts/bootstrap.ps127
-rw-r--r--toolsrc/vcpkg.sln1
3 files changed, 25 insertions, 28 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"))
{
diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln
index 3d12aafaf..8155e0882 100644
--- a/toolsrc/vcpkg.sln
+++ b/toolsrc/vcpkg.sln
@@ -19,7 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{F589
..\scripts\internalCI.ps1 = ..\scripts\internalCI.ps1
..\scripts\ports.cmake = ..\scripts\ports.cmake
..\scripts\SHA256Hash.ps1 = ..\scripts\SHA256Hash.ps1
- ..\scripts\VcpkgPowershellUtils.ps1 = ..\scripts\VcpkgPowershellUtils.ps1
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cmake", "cmake", "{A0122231-04D5-420B-81CA-7960946E5E65}"