[bootstrap] Use "unknownhash" if git is not available. Resolves #305

This commit is contained in:
Alexander Karatarakis 2016-11-21 18:10:21 -08:00
parent 891fe4434c
commit a65f4c3c0b

View File

@ -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)