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