X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=golang%2Finstall.ps1;h=779472f81b3fd5ff1e477bd1f3e2eae091469d44;hb=a05e632457ce06fe3ae4a48ba5f8f9056659dc11;hp=f2ded216bd3d43facc2773dcb1e2fbb6c4b7a4d7;hpb=fa5fc38ac31c8ef3ed259437f2459bcb6d240387;p=webi-installers%2F.git diff --git a/golang/install.ps1 b/golang/install.ps1 index f2ded21..779472f 100644 --- a/golang/install.ps1 +++ b/golang/install.ps1 @@ -1,7 +1,8 @@ #!/usr/bin/env pwsh $pkg_cmd_name = "go" -$pkg_download = "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE" +New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | out-null +$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE" $pkg_src = "$Env:USERPROFILE\.local\opt\$pkg_cmd_name-v$Env:WEBI_VERSION" @@ -9,6 +10,13 @@ $pkg_dst = "$Env:USERPROFILE\.local\opt\$pkg_cmd_name" $pkg_dst_cmd = "$pkg_dst\bin\$pkg_cmd_name" $pkg_dst_bin = "$pkg_dst\bin" +if (!(Get-Command "git.exe" -ErrorAction SilentlyContinue)) +{ + & "$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 IF (!(Test-Path -Path "$pkg_download")) { @@ -47,29 +55,33 @@ 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 | out-null } # Special to go: re-run all go tooling builds echo "Building go language tools..." echo gopls & "$pkg_dst_cmd" get golang.org/x/tools/gopls echo golint -& "$pkg_dst_cmd" get golang.org/x/lint/golint +& "$pkg_dst_cmd" get golang.org/x/lint/golint echo errcheck -& "$pkg_dst_cmd" get github.com/kisielk/errcheck +& "$pkg_dst_cmd" get github.com/kisielk/errcheck echo gotags -& "$pkg_dst_cmd" get github.com/jstemmer/gotags +& "$pkg_dst_cmd" get github.com/jstemmer/gotags echo goimports -& "$pkg_dst_cmd" get golang.org/x/tools/cmd/goimports +& "$pkg_dst_cmd" get golang.org/x/tools/cmd/goimports echo gorename -& "$pkg_dst_cmd" get golang.org/x/tools/cmd/gorename +& "$pkg_dst_cmd" get golang.org/x/tools/cmd/gorename echo gotype -& "$pkg_dst_cmd" get golang.org/x/tools/cmd/gotype +& "$pkg_dst_cmd" get golang.org/x/tools/cmd/gotype echo stringer -& "$pkg_dst_cmd" get golang.org/x/tools/cmd/stringer +& "$pkg_dst_cmd" get golang.org/x/tools/cmd/stringer # Add to path -& "$Env:USERPROFILE\.local\bin\pathman.exe" add %USERPROFILE%\.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 # Special to go: add default GOBIN to PATH -& "$Env:USERPROFILE\.local\bin\pathman.exe" add %USERPROFILE%\go\bin +& "$Env:USERPROFILE\.local\bin\pathman.exe" add ~/go/bin +#& "$Env:USERPROFILE\.local\bin\pathman.exe" add "$Env:USERPROFILE\go\bin" +#& "$Env:USERPROFILE\.local\bin\pathman.exe" add %USERPROFILE%\go\bin