aboutsummaryrefslogtreecommitdiff
path: root/scripts/bootstrap.ps1
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2017-09-21 12:22:00 -0700
committerGitHub <noreply@github.com>2017-09-21 12:22:00 -0700
commitfac96eb344a500405ab65b7e7f3755af0ad00b7e (patch)
treef9e3376ca1a8f2de408e087e42ae393f224d6c42 /scripts/bootstrap.ps1
parent46db0f03fcb42d9f738474885fda372160362e44 (diff)
parent1bbce1ee844262647f994afd5f31da12d938e7ee (diff)
downloadvcpkg-fac96eb344a500405ab65b7e7f3755af0ad00b7e.tar.gz
vcpkg-fac96eb344a500405ab65b7e7f3755af0ad00b7e.zip
Merge branch 'master' into master
Diffstat (limited to 'scripts/bootstrap.ps1')
-rw-r--r--scripts/bootstrap.ps128
1 files changed, 22 insertions, 6 deletions
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1
index b7bc5afab..b874afd8c 100644
--- a/scripts/bootstrap.ps1
+++ b/scripts/bootstrap.ps1
@@ -6,22 +6,37 @@ param(
$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root
+Write-Verbose("vcpkg Path " + $vcpkgRootDir)
+
$gitHash = "unknownhash"
-if (Get-Command "git" -ErrorAction SilentlyContinue)
+$oldpath = $env:path
+try
+{
+ $env:path += ";$vcpkgRootDir\downloads\MinGit-2.14.1-32-bit\cmd"
+ if (Get-Command "git" -ErrorAction SilentlyContinue)
+ {
+ $gitHash = git log HEAD -n 1 --format="%cd-%H" --date=short
+ if ($LASTEXITCODE -ne 0)
+ {
+ $gitHash = "unknownhash"
+ }
+ }
+}
+finally
{
- $gitHash = git rev-parse HEAD
+ $env:path = $oldpath
}
-Write-Verbose("Git hash is " + $gitHash)
+Write-Verbose("Git repo version string is " + $gitHash)
$vcpkgSourcesPath = "$vcpkgRootDir\toolsrc"
-Write-Verbose("vcpkg Path " + $vcpkgSourcesPath)
if (!(Test-Path $vcpkgSourcesPath))
{
New-Item -ItemType directory -Path $vcpkgSourcesPath -force | Out-Null
}
-try{
+try
+{
pushd $vcpkgSourcesPath
$msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1
$msbuildExe = $msbuildExeWithPlatformToolset[0]
@@ -34,6 +49,7 @@ try{
Copy-Item $vcpkgSourcesPath\Release\vcpkg.exe $vcpkgRootDir\vcpkg.exe | Out-Null
Copy-Item $vcpkgSourcesPath\Release\vcpkgmetricsuploader.exe $vcpkgRootDir\scripts\vcpkgmetricsuploader.exe | Out-Null
}
-finally{
+finally
+{
popd
}