|
|
@@ -1,8 +1,10 @@
|
|
|
#!/usr/bin/env bash
|
|
|
# Simple dev tool launcher - builds if needed
|
|
|
-
|
|
|
set -euo pipefail
|
|
|
|
|
|
+# Change to script's directory
|
|
|
+cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
+
|
|
|
# Colors
|
|
|
GREEN='\033[0;32m'
|
|
|
RED='\033[0;31m'
|
|
|
@@ -30,12 +32,9 @@ if [[ ! -f "$BINARY" ]] || [[ "main.go" -nt "$BINARY" ]]; then
|
|
|
error "Go not installed. Install with: sudo pacman -S go"
|
|
|
exit 1
|
|
|
fi
|
|
|
-
|
|
|
log "Building dev tool..."
|
|
|
mkdir -p bin
|
|
|
-
|
|
|
go mod tidy
|
|
|
-
|
|
|
if go build -ldflags="-s -w" -o "$BINARY" main.go; then
|
|
|
log "✅ Built: $BINARY"
|
|
|
else
|