Преглед на файлове

Windows: make.ps1 calc root

Signed-off-by: John Howard <jhoward@microsoft.com>
John Howard преди 8 години
родител
ревизия
8c93a41044
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      hack/make.ps1

+ 5 - 1
hack/make.ps1

@@ -303,7 +303,10 @@ Function Run-UnitTests() {
 # Start of main code.
 # Start of main code.
 Try {
 Try {
     Write-Host -ForegroundColor Cyan "INFO: make.ps1 starting at $(Get-Date)"
     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.
     # 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 }
     if ($All) { $Client=$True; $Daemon=$True; $DCO=$True; $PkgImports=$True; $GoFormat=$True; $TestUnit=$True }
@@ -396,6 +399,7 @@ Catch [Exception] {
     Write-Host
     Write-Host
 }
 }
 Finally {
 Finally {
+    Pop-Location # As we pushed to the root of the repo as the very first thing
     if ($global:pushed) { Pop-Location }
     if ($global:pushed) { Pop-Location }
     Write-Host -ForegroundColor Cyan "INFO: make.ps1 ended at $(Get-Date)"
     Write-Host -ForegroundColor Cyan "INFO: make.ps1 ended at $(Get-Date)"
 }
 }