Spaces:
Sleeping
Sleeping
Commit ·
5c44abb
1
Parent(s): 67e589d
Sync from GitHub 1bf35c1: sync.ps1: use the script's own repo so it works from any folder
Browse files
sync.ps1
CHANGED
|
@@ -102,7 +102,8 @@ function Update-IndexJson([string]$Root) {
|
|
| 102 |
}
|
| 103 |
|
| 104 |
# ---- Start ------------------------------------------------------------------
|
| 105 |
-
|
|
|
|
| 106 |
if ($LASTEXITCODE -ne 0) { Fail "Not a git repository" }
|
| 107 |
Set-Location $repoRoot
|
| 108 |
$branch = git rev-parse --abbrev-ref HEAD
|
|
|
|
| 102 |
}
|
| 103 |
|
| 104 |
# ---- Start ------------------------------------------------------------------
|
| 105 |
+
# Use the repo this script lives in, so it works from any current folder.
|
| 106 |
+
$repoRoot = git -C $PSScriptRoot rev-parse --show-toplevel 2>$null
|
| 107 |
if ($LASTEXITCODE -ne 0) { Fail "Not a git repository" }
|
| 108 |
Set-Location $repoRoot
|
| 109 |
$branch = git rev-parse --abbrev-ref HEAD
|