I'm now forced to manually add git to the path myself.

master
Zed A. Shaw 4 weeks ago
parent e94d35cc14
commit 2ab3888f56
  1. 17
      base.ps1

@ -225,7 +225,8 @@ $installs=@(
'Genivia.ugrep',
'Microsoft.WindowsTerminal',
'Kitware.CMake',
'Microsoft.VCRedist.2015+.x64'
'Microsoft.VCRedist.2015+.x64',
'Git.Git'
)
Write-Warning "About to install the following software:"
@ -240,11 +241,15 @@ foreach($pkg in $installs) {
Start-Process -NoNewWindow -Wait winget -ArgumentList 'install',$pkg
}
Write-Warning "!!!!!! GIT GIT GIT !!!!!"
Write-Warning "As of December 2024, my tests showed that git is not added to the path when you install it. I know, shocker right? I will attempt to install it interactively here. But if you cannot type 'git' in Terminal after you restart terminal then you will need to run: winget install git"
Read-Host -Prompt "Press any key to say you read the above" | Out-Null
$gitPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$env:APPDATA\..\Local\Programs\Git\cmd")
winget install -i Git.Git
if($env:PATH.contains($gitPath)) {
Write-Warning "!! Looks like your git installed correctly, but if it fails to run then uninstall it with 'winget remove git.git' then install it again with 'winget install git.git'"
} else {
Write-Warning "!! Git.Git did not add itself to the Path. The directory $gitPath is missing so I'll add it now."
$newPath = $Env:PATH + ";$gitPath"
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")
}
$winlibsPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$env:APPDATA\..\Local\Programs\WinLibs")
@ -277,5 +282,3 @@ if($env:PATH.contains($winlibsPath)) {
$newPath = $Env:PATH + ";$winlibsPath\mingw64\bin"
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")
}
Write-Warning "!!! CLOSE THIS POWERSHELL AND START A NEW ONE TO UPDATE PATH!"

Loading…
Cancel
Save