From 8c93a41044b90834b8d3fcdb50ed3619ba3cbf71 Mon Sep 17 00:00:00 2001 From: John Howard Date: Mon, 5 Dec 2016 13:26:04 -0800 Subject: [PATCH] Windows: make.ps1 calc root Signed-off-by: John Howard --- hack/make.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hack/make.ps1 b/hack/make.ps1 index 6084b34920..16ab49df34 100644 --- a/hack/make.ps1 +++ b/hack/make.ps1 @@ -303,7 +303,10 @@ Function Run-UnitTests() { # Start of main code. Try { Write-Host -ForegroundColor Cyan "INFO: make.ps1 starting at $(Get-Date)" - $root=$(pwd) + + # Get to the root of the repo + $root = $(Split-Path $MyInvocation.MyCommand.Definition -Parent | Split-Path -Parent) + Push-Location $root # Handle the "-All" shortcut to turn on all things we can handle. if ($All) { $Client=$True; $Daemon=$True; $DCO=$True; $PkgImports=$True; $GoFormat=$True; $TestUnit=$True } @@ -396,6 +399,7 @@ Catch [Exception] { Write-Host } Finally { + Pop-Location # As we pushed to the root of the repo as the very first thing if ($global:pushed) { Pop-Location } Write-Host -ForegroundColor Cyan "INFO: make.ps1 ended at $(Get-Date)" }