diff --git a/build-scripts/windows-build.bat b/build-scripts/windows-build.bat new file mode 100644 index 0000000..ba35965 --- /dev/null +++ b/build-scripts/windows-build.bat @@ -0,0 +1,51 @@ +@echo off + +REM Step 1: Build Macrame Go application for Windows +echo Building Macrame Go Application for Windows... + +go build -ldflags "-H=windowsgui" -o Macrame.exe main.go + +IF %ERRORLEVEL% NEQ 0 ( + echo Go build failed! + exit /b %ERRORLEVEL% +) ELSE ( + echo Go build was succesful! +) + +REM Step 2: Build Macrame Vue UI +echo Moving to ui directory and building Vue UI +cd ui + +echo Running npm install... +call npm install +IF %ERRORLEVEL% NEQ 0 ( + echo npm install failed! + exit /b %ERRORLEVEL% +) + +echo Running npm run build... +call npm run build +IF %ERRORLEVEL% NEQ 0 ( + echo npm run build failed! + exit /b %ERRORLEVEL% +) + +REM Step 3: Cleanup root directory of build files. +echo Cleaning up root directory... + +echo Removing directories: app, ui and build-scripts +rmdir /s /q app +rmdir /s /q ui +rmdir /s /q build-scripts + +for %%F in (*) do ( + set "file=%%~nxF" + if /I not "!file!"=="Macrame.exe" if /I not "!file!"=="favicon.ico" if /I not "!file!"=="README.md" ( + echo Deleting !file! + del /f /q "%%F" + ) +) + +echo Build and cleanup complete. + + diff --git a/build.sh b/build.sh deleted file mode 100644 index 65eb876..0000000 --- a/build.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Set the name of the build directory -BUILD_DIR="Macrame_$(date +'%m%d%H%M%S')" - -# Build the Go application -go build -ldflags "-H=windowsgui" -o Macrame.exe main.go - -# Build the frontend -cd fe -npm run build - -cd ../builds - -# Create the new build directory -mkdir $BUILD_DIR -mkdir $BUILD_DIR/macros -mkdir $BUILD_DIR/panels -mkdir $BUILD_DIR/panels/test_panel -mkdir $BUILD_DIR/public -mkdir $BUILD_DIR/public/assets - -# Move the generated files to the new build directory -cp ../Macrame.exe $BUILD_DIR/Macrame.exe -cp ../favicon.ico $BUILD_DIR/favicon.ico -find ../macros -type f ! -name 'ED-*' -exec cp --parents {} "$BUILD_DIR/macros/" \; -cp -r ../panels/test_panel/* $BUILD_DIR/panels/test_panel/ -mv ../public/* $BUILD_DIR/public/ - -# cp ../install.bat $BUILD_DIR/install.bat - -powershell -Command "Compress-Archive -Path $BUILD_DIR/* -DestinationPath $BUILD_DIR.zip -Force" - -# Print the path to the new build directory -echo "Build directory: ../$BUILD_DIR" \ No newline at end of file