We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6802ed9 commit c059384Copy full SHA for c059384
cli.ps1
@@ -0,0 +1,14 @@
1
+##Built in PowerShell v5.1, but should work in any version.
2
+$CUR_DIR = Get-Location | Select-Object -ExpandProperty Path
3
+$SCRIPT_DIR = $PSScriptRoot
4
+$date = [DateTimeOffset]::Now.ToUnixTimeSeconds()
5
+Set-Location $SCRIPT_DIR
6
+go build -o $CUR_DIR\op.exe -ldflags "-X main.gitCommit=$(git rev-parse HEAD) -X main.buildEpochSec=$date" "$SCRIPT_DIR\\cli\\op.go"
7
+if ($?) {
8
+ Set-Location $CUR_DIR
9
+ $opargs = './op.exe ' + $args -join " "
10
+ Invoke-Expression $opargs
11
+} else {
12
+ Write-Host "Failed to build op.exe. cli.ps1 may not be working correctly."
13
+ Exit
14
+}
0 commit comments