diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-21 18:10:21 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-21 18:10:21 -0800 |
| commit | a65f4c3c0b36ee494df0cada4ebfdcf342218cf1 (patch) | |
| tree | a09c1f45d87ab1c6fcef6c5cafce22f734916720 /scripts/bootstrap.ps1 | |
| parent | 891fe4434cc670aba2a82ed2cdcfb3fe30e0f93c (diff) | |
| download | vcpkg-a65f4c3c0b36ee494df0cada4ebfdcf342218cf1.tar.gz vcpkg-a65f4c3c0b36ee494df0cada4ebfdcf342218cf1.zip | |
[bootstrap] Use "unknownhash" if git is not available. Resolves #305
Diffstat (limited to 'scripts/bootstrap.ps1')
| -rw-r--r-- | scripts/bootstrap.ps1 | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 182155146..bcb570b39 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -7,9 +7,12 @@ param( $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root -$gitHash = git rev-parse HEAD +$gitHash = "unknownhash" +if (Get-Command "git.exe" -ErrorAction SilentlyContinue) +{ + $gitHash = git rev-parse HEAD +} Write-Verbose("Git hash is " + $gitHash) -$gitStartOfHash = $gitHash.substring(0,6) $vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" Write-Verbose("vcpkg Path " + $vcpkgSourcesPath) |
