From f5f6f25a4a12d363823b13f62892ff13ce8f69ed Mon Sep 17 00:00:00 2001 From: Jesse Malotaux Date: Thu, 17 Apr 2025 11:17:09 +0200 Subject: [PATCH] Build script added --- .gitignore | 1 + build.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 build.sh diff --git a/.gitignore b/.gitignore index 1fbc2a7..305422a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ be/log.txt public macros/* +builds node_modules \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..9d69858 --- /dev/null +++ b/build.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Set the name of the build directory +BUILD_DIR="Macrame_$(date +'%m%d%H%M%S')" + +# Build the Go application +cd be +go build -o Macrame.exe main.go +go build -o Setup.exe setup/setup.go + +# Build the frontend +cd ../fe +npm run build + +cd ../builds + +# Create the new build directory +mkdir $BUILD_DIR +mkdir $BUILD_DIR/be +mkdir $BUILD_DIR/macros +mkdir $BUILD_DIR/panels +mkdir $BUILD_DIR/public + +# Move the generated files to the new build directory +mv ../be/Macrame.exe $BUILD_DIR/be/Macrame.exe +mv ../be/Setup.exe $BUILD_DIR/be/Setup.exe +cp -r ../macros/* $BUILD_DIR/macros/ +cp -r ../panels/* $BUILD_DIR/panels/ +mv ../public/* $BUILD_DIR/public/ + +cp ../install.bat $BUILD_DIR/install.bat +cp ../Macrame.lnk $BUILD_DIR/Macrame.lnk + +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