updated 'run.sh' and 'run.bat' so the process name is 'qgato'
Some checks failed
Run Integration Tests / test (push) Failing after 1m43s

This commit is contained in:
partisan 2024-12-19 18:45:48 +01:00
parent 287c7a7a1d
commit 5b90a372a1
2 changed files with 23 additions and 4 deletions

14
run.bat
View file

@ -60,15 +60,25 @@ if "%BUILD_MODE%"=="true" (
)
echo Build successful! Output: %CD%\%BUILD_OUTPUT%
) else (
rem Check if the executable exists
if not exist "%BUILD_OUTPUT%" (
echo Executable not found. Building it first...
go build -o "%BUILD_OUTPUT%" !GO_FILES!
if errorlevel 1 (
echo Build failed! Unable to run the application.
exit /b 1
)
)
rem Construct the command
set CMD=go run !GO_FILES! !SKIP_CONFIG!
set CMD="%BUILD_OUTPUT% !SKIP_CONFIG!"
if not "%PORT%"=="" set CMD=!CMD! --port %PORT%
if not "%DOMAIN%"=="" set CMD=!CMD! --domain %DOMAIN%
rem Informative output
echo Starting application with command: !CMD!
rem Run the Go program with the constructed command
rem Run the application
call !CMD!
)

13
run.sh
View file

@ -51,12 +51,21 @@ if $BUILD_MODE; then
fi
else
# Run mode
CMD="go run $GO_FILES $SKIP_CONFIG"
CMD="./$BUILD_OUTPUT $SKIP_CONFIG"
[ -n "$PORT" ] && CMD="$CMD --port $PORT"
[ -n "$DOMAIN" ] && CMD="$CMD --domain $DOMAIN"
if [ ! -f "$SCRIPT_DIR/$BUILD_OUTPUT" ]; then
echo "Executable not found. Building it first..."
go build -o "$SCRIPT_DIR/$BUILD_OUTPUT" $GO_FILES
if [ $? -ne 0 ]; then
echo "Build failed! Unable to run the application."
exit 1
fi
fi
echo "Starting application with command: $CMD"
# Run the Go program with the constructed command
# Run the executable
eval $CMD
fi