diff options
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 } |
