From 66ddfcdaffc596792eb8d4256bda23b07da8aa16 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Wed, 1 Jun 2016 11:13:49 -0700 Subject: [PATCH] Make git describe work relative to script So that you don't have to watch your CWD when running commands from the build module. --- build.psm1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index a2274492ff..bb1fed04ac 100644 --- a/build.psm1 +++ b/build.psm1 @@ -53,7 +53,8 @@ function Start-PSBuild { [string]$msbuildConfiguration = "Release" ) - git describe --dirty --abbrev=60 > "$psscriptroot/powershell.version" + # save Git description to file for PowerShell to include in PSVersionTable + git --git-dir="$PSScriptRoot/.git" describe --dirty --abbrev=60 > "$psscriptroot/powershell.version" # simplify ParameterSetNames if ($PSCmdlet.ParameterSetName -eq 'FullCLR') {