aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-11-21 18:10:21 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2016-11-21 18:10:21 -0800
commita65f4c3c0b36ee494df0cada4ebfdcf342218cf1 (patch)
treea09c1f45d87ab1c6fcef6c5cafce22f734916720
parent891fe4434cc670aba2a82ed2cdcfb3fe30e0f93c (diff)
downloadvcpkg-a65f4c3c0b36ee494df0cada4ebfdcf342218cf1.tar.gz
vcpkg-a65f4c3c0b36ee494df0cada4ebfdcf342218cf1.zip
[bootstrap] Use "unknownhash" if git is not available. Resolves #305
-rw-r--r--scripts/bootstrap.ps17
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)