Ignore vendor dir for builds without modules.txt

This commit is contained in:
Stu Leak 2026-01-04 21:27:13 -05:00
parent 5cdb3ae131
commit dfacdf45a7
2 changed files with 6 additions and 0 deletions

View File

@ -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 ""

View File

@ -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 ""