Replaced all instances of webi.ps1 with webi-pwsh.ps1
[webi-installers/.git] / golang / install.ps1
index eb0dab1e6f0501f7f27cb0a07bcaaa603455cf7a..8b7f8c2b34fe06995f760f701adf00a0fdef6a66 100644 (file)
@@ -11,7 +11,9 @@ $pkg_dst_bin = "$pkg_dst\bin"
 
 if (!(Get-Command "git.exe" -ErrorAction SilentlyContinue))
 {
-    & powershell -ExecutionPolicy Bypass "$Env:USERPROFILE\.local\bin\webi.ps1" git
+    & "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1" git
+    # because we need git.exe to be available to golang immediately
+    $Env:PATH = "$Env:USERPROFILE\.local\opt\git\cmd;$Env:PATH"
 }
 
 # Fetch archive
@@ -52,7 +54,7 @@ IF (!(Test-Path -Path "$pkg_src"))
 echo "Copying into '$pkg_dst' from '$pkg_src'"
 Remove-Item -Path "$pkg_dst" -Recurse -ErrorAction Ignore
 Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
-IF (!(Test-Path -Path go\bin)) { New-Item -Path go\bin -ItemType Directory }
+IF (!(Test-Path -Path go\bin)) { New-Item -Path go\bin -ItemType Directory -Force }
 
 # Special to go: re-run all go tooling builds
 echo "Building go language tools..."
@@ -74,7 +76,7 @@ echo stringer
 & "$pkg_dst_cmd" get golang.org/x/tools/cmd/stringer 
 
 # Add to path
-& "$Env:USERPROFILE\.local\bin\pathman.exe" add ~/.local/opt/go/bin"
+& "$Env:USERPROFILE\.local\bin\pathman.exe" add ~/.local/opt/go/bin
 #& "$Env:USERPROFILE\.local\bin\pathman.exe" add "$Env:USERPROFILE\.local\opt\go\bin"
 #& "$Env:USERPROFILE\.local\bin\pathman.exe" add %USERPROFILE%\.local\opt\go\bin