From dfacdf45a7f07ac98ec7349e80d8008dc28157b7 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Sun, 4 Jan 2026 21:27:13 -0500 Subject: [PATCH] Ignore vendor dir for builds without modules.txt --- scripts/build-linux.sh | 3 +++ scripts/build.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/build-linux.sh b/scripts/build-linux.sh index 122320f..3327f95 100755 --- a/scripts/build-linux.sh +++ b/scripts/build-linux.sh @@ -55,6 +55,9 @@ export CGO_ENABLED=1 export GOCACHE="$PROJECT_ROOT/.cache/go-build" export GOMODCACHE="$PROJECT_ROOT/.cache/go-mod" mkdir -p "$GOCACHE" "$GOMODCACHE" +if [ -d "$PROJECT_ROOT/vendor" ] && [ ! -f "$PROJECT_ROOT/vendor/modules.txt" ]; then + export GOFLAGS="${GOFLAGS:-} -mod=mod" +fi if go build -o "$BUILD_OUTPUT" .; then echo "Build successful! (VideoTools $APP_VERSION)" echo "" diff --git a/scripts/build.sh b/scripts/build.sh index fa0d4af..8cca5c7 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -64,6 +64,9 @@ case "$OS" in echo "Building VideoTools $APP_VERSION for Windows..." export CGO_ENABLED=1 + if [ -d "$PROJECT_ROOT/vendor" ] && [ ! -f "$PROJECT_ROOT/vendor/modules.txt" ]; then + export GOFLAGS="${GOFLAGS:-} -mod=mod" + fi if go build -ldflags="-H windowsgui -s -w" -o VideoTools.exe .; then echo "Build successful! (VideoTools $APP_VERSION)" echo ""