|
1 | 1 | #!/usr/bin/env pwsh
|
2 | 2 | $ErrorActionPreference = "Stop"
|
3 | 3 | Set-StrictMode -Version Latest
|
4 |
| -#Requires -Modules @{ ModuleName = "poshy-env-var"; RequiredVersion = "0.6.0" } |
5 |
| -#Requires -Modules @{ ModuleName = "poshy-lucidity"; RequiredVersion = "0.4.1" } |
6 | 4 |
|
7 | 5 |
|
8 |
| -if (-not (Test-Command go) -and (-not (Get-Variable -Name PWSHRC_FORCE_MODULES_EXPORT_UNSUPPORTED -Scope Global -ValueOnly -ErrorAction SilentlyContinue))) { |
| 6 | +if (-not (Get-Command go -ErrorAction SilentlyContinue) -and (-not (Get-Variable -Name PWSHRC_FORCE_MODULES_EXPORT_UNSUPPORTED -Scope Global -ValueOnly -ErrorAction SilentlyContinue))) { |
9 | 7 | return
|
| 8 | +} else { |
| 9 | + . "$PSScriptRoot/poshy-wrap-golang.ps1" |
10 | 10 | }
|
11 |
| - |
12 |
| -function Invoke-GoBuild { |
13 |
| - go build @args |
14 |
| -} |
15 |
| -Set-Alias -Name gob -Value Invoke-GoBuild |
16 |
| -Export-ModuleMember -Function Invoke-GoBuild -Alias gob |
17 |
| - |
18 |
| -function Invoke-GoClean { |
19 |
| - go clean @args |
20 |
| -} |
21 |
| -Set-Alias -Name goc -Value Invoke-GoClean |
22 |
| -Export-ModuleMember -Function Invoke-GoClean -Alias goc |
23 |
| - |
24 |
| -function Invoke-GoDoc { |
25 |
| - go doc @args |
26 |
| -} |
27 |
| -Set-Alias -Name god -Value Invoke-GoDoc |
28 |
| -Export-ModuleMember -Function Invoke-GoDoc -Alias god |
29 |
| - |
30 |
| -function Invoke-GoEnv { |
31 |
| - go env @args |
32 |
| -} |
33 |
| -Set-Alias -Name goe -Value Invoke-GoEnv |
34 |
| -Export-ModuleMember -Function Invoke-GoEnv -Alias goe |
35 |
| - |
36 |
| -function Invoke-GoFmt { |
37 |
| - go fmt @args |
38 |
| -} |
39 |
| -Set-Alias -Name gof -Value Invoke-GoFmt |
40 |
| -Export-ModuleMember -Function Invoke-GoFmt -Alias gof |
41 |
| - |
42 |
| -function Invoke-GoFmtEllipsis { |
43 |
| - go go fmt ./... @args |
44 |
| -} |
45 |
| -Set-Alias -Name gofa -Value Invoke-GoFmtEllipsis |
46 |
| -Export-ModuleMember -Function Invoke-GoFmtEllipsis -Alias gofa |
47 |
| - |
48 |
| -function Invoke-GoFix { |
49 |
| - go fix @args |
50 |
| -} |
51 |
| -Set-Alias -Name gofx -Value Invoke-GoFix |
52 |
| -Export-ModuleMember -Function Invoke-GoFix -Alias gofx |
53 |
| - |
54 |
| -function Invoke-GoGet { |
55 |
| - go get @args |
56 |
| -} |
57 |
| -Set-Alias -Name gog -Value Invoke-GoGet |
58 |
| -Export-ModuleMember -Function Invoke-GoGet -Alias gog |
59 |
| - |
60 |
| -function Invoke-GoGetEllipsis { |
61 |
| - go get ./... @args |
62 |
| -} |
63 |
| -Set-Alias -Name goga -Value Invoke-GoGetEllipsis |
64 |
| -Export-ModuleMember -Function Invoke-GoGetEllipsis -Alias goga |
65 |
| - |
66 |
| -function Invoke-GoInstall { |
67 |
| - go install @args |
68 |
| -} |
69 |
| -Set-Alias -Name goi -Value Invoke-GoInstall |
70 |
| -Export-ModuleMember -Function Invoke-GoInstall -Alias goi |
71 |
| - |
72 |
| -function Invoke-GoList { |
73 |
| - go list @args |
74 |
| -} |
75 |
| -Set-Alias -Name gol -Value Invoke-GoList |
76 |
| -Export-ModuleMember -Function Invoke-GoList -Alias gol |
77 |
| - |
78 |
| -function Invoke-GoMod { |
79 |
| - go mod @args |
80 |
| -} |
81 |
| -Set-Alias -Name gom -Value Invoke-GoMod |
82 |
| -Export-ModuleMember -Function Invoke-GoMod -Alias gom |
83 |
| - |
84 |
| -function Set-LocationGoPath { |
85 |
| - Get-EnvVarPathItem -Process -Name GOPATH ` |
86 |
| - | Select-Object -First 1 ` |
87 |
| - | Set-Location |
88 |
| -} |
89 |
| -Set-Alias -Name gopa -Value Set-LocationGoPath |
90 |
| -Export-ModuleMember -Function Set-LocationGoPath -Alias gopa |
91 |
| - |
92 |
| -function Set-LocationGoPathBin { |
93 |
| - Get-EnvVarPathItem -Process -Name GOPATH ` |
94 |
| - | Select-Object -First 1 ` |
95 |
| - | ForEach-Object { |
96 |
| - Set-Location $_\bin |
97 |
| - } |
98 |
| -} |
99 |
| -Set-Alias -Name gopb -Value Set-LocationGoPathBin |
100 |
| -Export-ModuleMember -Function Set-LocationGoPathBin -Alias gopb |
101 |
| - |
102 |
| -function Set-LocationGoPathSrc { |
103 |
| - Get-EnvVarPathItem -Process -Name GOPATH ` |
104 |
| - | Select-Object -First 1 ` |
105 |
| - | ForEach-Object { |
106 |
| - Set-Location $_\src |
107 |
| - } |
108 |
| -} |
109 |
| -Set-Alias -Name gops -Value Set-LocationGoPathSrc |
110 |
| -Export-ModuleMember -Function Set-LocationGoPathSrc -Alias gops |
111 |
| - |
112 |
| -function Invoke-GoRun { |
113 |
| - go run @args |
114 |
| -} |
115 |
| -Set-Alias -Name gor -Value Invoke-GoRun |
116 |
| -Export-ModuleMember -Function Invoke-GoRun -Alias gor |
117 |
| - |
118 |
| -function Invoke-GoTest { |
119 |
| - go test @args |
120 |
| -} |
121 |
| -Set-Alias -Name got -Value Invoke-GoTest |
122 |
| -Export-ModuleMember -Function Invoke-GoTest -Alias got |
123 |
| - |
124 |
| -function Invoke-GoTestEllipsis { |
125 |
| - go test ./... @args |
126 |
| -} |
127 |
| -Set-Alias -Name gota -Value Invoke-GoTestEllipsis |
128 |
| -Export-ModuleMember -Function Invoke-GoTestEllipsis -Alias gota |
129 |
| - |
130 |
| -function Invoke-GoTool { |
131 |
| - go tool @args |
132 |
| -} |
133 |
| -Set-Alias -Name goto -Value Invoke-GoTool |
134 |
| -Export-ModuleMember -Function Invoke-GoTool -Alias goto |
135 |
| - |
136 |
| -function Invoke-GoToolCompile { |
137 |
| - go tool compile @args |
138 |
| -} |
139 |
| -Set-Alias -Name gotoc -Value Invoke-GoToolCompile |
140 |
| -Export-ModuleMember -Function Invoke-GoToolCompile -Alias gotoc |
141 |
| - |
142 |
| -function Invoke-GoToolDist { |
143 |
| - go tool dist @args |
144 |
| -} |
145 |
| -Set-Alias -Name gotod -Value Invoke-GoToolDist |
146 |
| -Export-ModuleMember -Function Invoke-GoToolDist -Alias gotod |
147 |
| - |
148 |
| -function Invoke-GoToolFix { |
149 |
| - go tool fix @args |
150 |
| -} |
151 |
| -Set-Alias -Name gotofx -Value Invoke-GoToolFix |
152 |
| -Export-ModuleMember -Function Invoke-GoToolFix -Alias gotofx |
153 |
| - |
154 |
| -function Invoke-GoVet { |
155 |
| - go vet @args |
156 |
| -} |
157 |
| -Set-Alias -Name gov -Value Invoke-GoVet |
158 |
| -Export-ModuleMember -Function Invoke-GoVet -Alias gov |
159 |
| - |
160 |
| -function Invoke-GoVersion { |
161 |
| - go version @args |
162 |
| -} |
163 |
| -Set-Alias -Name gove -Value Invoke-GoVersion |
164 |
| -Export-ModuleMember -Function Invoke-GoVersion -Alias gove |
165 |
| - |
166 |
| -function Invoke-GoWork { |
167 |
| - go work @args |
168 |
| -} |
169 |
| -Set-Alias -Name gow -Value Invoke-GoWork |
170 |
| -Export-ModuleMember -Function Invoke-GoWork -Alias gow |
0 commit comments