diff options
| author | Alexander Karatarakis <alex@karatarakis.com> | 2017-09-21 12:22:00 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-21 12:22:00 -0700 |
| commit | fac96eb344a500405ab65b7e7f3755af0ad00b7e (patch) | |
| tree | f9e3376ca1a8f2de408e087e42ae393f224d6c42 /scripts/bootstrap.ps1 | |
| parent | 46db0f03fcb42d9f738474885fda372160362e44 (diff) | |
| parent | 1bbce1ee844262647f994afd5f31da12d938e7ee (diff) | |
| download | vcpkg-fac96eb344a500405ab65b7e7f3755af0ad00b7e.tar.gz vcpkg-fac96eb344a500405ab65b7e7f3755af0ad00b7e.zip | |
Merge branch 'master' into master
Diffstat (limited to 'scripts/bootstrap.ps1')
| -rw-r--r-- | scripts/bootstrap.ps1 | 28 |
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 } |
