|
|
|
@ -920,6 +920,7 @@ $launchdir = Get-Location #store original CWD
|
|
|
|
|
$scriptfolder = Resolve-Path (Split-Path -Path $PSCommandPath -Parent) |
|
|
|
|
$punkfolder = "" |
|
|
|
|
$scriptroot = "$([System.IO.Path]::GetFileNameWithoutExtension($PSCommandPath))" |
|
|
|
|
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") |
|
|
|
|
|
|
|
|
|
if (-not (Get-Command "git" -ErrorAction SilentlyContinue)) { |
|
|
|
|
Write-Host "The git command doesn't seem to be available. Will attempt to install using winget." |
|
|
|
@ -1018,10 +1019,12 @@ if (-not(Test-Path -Path (Join-Path -Path $punkfolder -ChildPath ".git") -PathTy
|
|
|
|
|
git fetch origin |
|
|
|
|
if (($launchdir.Path) -eq ($scriptfolder.Path)) { |
|
|
|
|
if (Test-Path -Path "${scriptroot}.cmd") { |
|
|
|
|
Rename-Item -Path "${scriptroot}.cmd" -NewName "${scriptroot}.cmd.lastrun" -Force |
|
|
|
|
#rename-item won't allow overwriting existing target file |
|
|
|
|
Move-Item -Path "${scriptroot}.cmd" -Destination "${scriptroot}.cmd.lastrun" -Force |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
git pull $git_upstream master |
|
|
|
|
git checkout $scriptroot.cmd |
|
|
|
|
git branch --set-upstream-to=origin/master master |
|
|
|
|
|
|
|
|
|
Set-Location $launchdir #restore original CWD |
|
|
|
|