diff --git a/.gitignore b/.gitignore index 1c0f32e..29ea32a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -# Air (hot reload) generated -.air - # temp folder tmp diff --git a/scripts/.air-windows.toml b/scripts/.air-windows.toml deleted file mode 100644 index e55c151..0000000 --- a/scripts/.air-windows.toml +++ /dev/null @@ -1,15 +0,0 @@ -root = "." -tmp_dir = ".air" - -[build] -bin = "./.air/slash.exe --mode dev" -cmd = "go build -o ./.air/slash.exe ./bin/slash/main.go" -delay = 1000 -exclude_dir = [".air", "frontend", "build"] -exclude_file = [] -exclude_regex = [] -exclude_unchanged = false -follow_symlink = false -full_bin = "" -send_interrupt = true -kill_delay = 2000 diff --git a/scripts/.air.toml b/scripts/.air.toml deleted file mode 100644 index 81e1cba..0000000 --- a/scripts/.air.toml +++ /dev/null @@ -1,15 +0,0 @@ -root = "." -tmp_dir = ".air" - -[build] -bin = "./.air/slash --mode dev" -cmd = "go build -o ./.air/slash ./bin/slash/main.go" -delay = 1000 -exclude_dir = [".air", "frontend", "build"] -exclude_file = [] -exclude_regex = [] -exclude_unchanged = false -follow_symlink = false -full_bin = "" -send_interrupt = true -kill_delay = 2000 diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100644 index 0000000..a141162 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Exit when any command fails +set -e + +# Get the script directory and change to the project root +cd "$(dirname "$0")/../" + +# Detect the operating system +OS=$(uname -s) + +# Set output file name based on the OS +if [[ "$OS" == *"CYGWIN"* || "$OS" == *"MINGW"* || "$OS" == *"MSYS"* ]]; then + OUTPUT="./build/slash.exe" +else + OUTPUT="./build/slash" +fi + +echo "Building for $OS..." + +# Build the executable +go build -o "$OUTPUT" ./bin/slash/main.go + +# Output the success message +echo "Build successful!" + +# Output the command to run +echo "To run the application, execute the following command:" +echo "$OUTPUT --mode dev"