-
Notifications
You must be signed in to change notification settings - Fork 186
Expand file tree
/
Copy pathgo.ps1
More file actions
21 lines (18 loc) · 814 Bytes
/
go.ps1
File metadata and controls
21 lines (18 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Ensure that script errors stop execution
$ErrorActionPreference = "Stop"
# Determine the root directory of the project.
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$ROOTDIR = (Resolve-Path (Join-Path $scriptDir "..")).Path
# Source the ensure-go-installed functionality.
# (This assumes you have a corresponding PowerShell version of ensure-go-installed.
# If not, you could call the bash version via bash.exe if available.)
$ensureScript = Join-Path $ROOTDIR "script\ensure-go-installed.ps1"
if (Test-Path $ensureScript) {
. $ensureScript
} else {
Write-Error "Unable to locate '$ensureScript'. Please provide a PowerShell version of ensure-go-installed."
}
# Execute the actual 'go' command with passed arguments.
# This re-invokes the Go tool in PATH.
$goExe = "go"
& $goExe @args