chore: update build script

This commit is contained in:
johnnyjoy
2025-05-07 21:06:23 +08:00
parent ab133a94c3
commit cb1413be2a
4 changed files with 29 additions and 33 deletions
-3
View File
@@ -1,6 +1,3 @@
# Air (hot reload) generated
.air
# temp folder # temp folder
tmp tmp
-15
View File
@@ -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
-15
View File
@@ -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
+29
View File
@@ -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"