From a65f4c3c0b36ee494df0cada4ebfdcf342218cf1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 21 Nov 2016 18:10:21 -0800 Subject: [PATCH] [bootstrap] Use "unknownhash" if git is not available. Resolves #305 --- scripts/bootstrap.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 1821551463..bcb570b398 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)