aboutsummaryrefslogtreecommitdiff
path: root/scripts/bootstrap.ps1
diff options
context:
space:
mode:
authorjasjuang <jasjuang@gmail.com>2017-09-22 08:16:32 -0700
committerjasjuang <jasjuang@gmail.com>2017-09-22 08:16:32 -0700
commitf643a8422f87c5a16e3cc77e3e321e34a45f7103 (patch)
tree419c9a2e74ab577aab0e868441b9a0e4c15d4919 /scripts/bootstrap.ps1
parent9989177fed607cdc9e20127ff7c22e3266e7c913 (diff)
parentfac96eb344a500405ab65b7e7f3755af0ad00b7e (diff)
downloadvcpkg-f643a8422f87c5a16e3cc77e3e321e34a45f7103.tar.gz
vcpkg-f643a8422f87c5a16e3cc77e3e321e34a45f7103.zip
Merge branch 'master' of https://github.com/jasjuang/vcpkg
Diffstat (limited to 'scripts/bootstrap.ps1')
-rw-r--r--scripts/bootstrap.ps128
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
}