From 02bab22a5d9a8e2fc7e4711a1368e2af92c90397 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Tue, 7 Jul 2026 14:57:30 +0100 Subject: [PATCH] fix: build tool from script directory (correct go.mod context) --- deploy.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/deploy.sh b/deploy.sh index 25190a4..d9872af 100755 --- a/deploy.sh +++ b/deploy.sh @@ -37,6 +37,7 @@ else fi # --- Common: pull + build --- +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" cd "$REPO_DIR" echo "[1/6] Pulling latest code..." git pull @@ -45,15 +46,10 @@ echo "[2/6] Building binary and helper tool..." export PATH=$PATH:/usr/local/go/bin go build -o "$BINARY_NAME" . +# Build helper tool from script directory (has correct go.mod with all deps) TOOL_BIN="/tmp/nextwks-tool" -TOOL_SRC="" -for TRY_DIR in "$REPO_DIR/tools/nextwks-tool" "$(dirname $0)/tools/nextwks-tool"; do - if [ -d "$TRY_DIR" ]; then - TOOL_SRC="$TRY_DIR" - break - fi -done -if [ -n "$TOOL_SRC" ]; then +TOOL_SRC="$SCRIPT_DIR/tools/nextwks-tool" +if [ -d "$TOOL_SRC" ]; then cd "$TOOL_SRC" go build -o "$TOOL_BIN" . 2>&1 && echo "[OK] Helper tool built" || echo "[WARN] Helper tool build failed" cd "$REPO_DIR"