Described all the code, added a build
This commit is contained in:
29
build.sh
Executable file
29
build.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define the list of target platforms
|
||||
PLATFORMS=("darwin-amd64" "linux-386" "linux-amd64" "windows-386" "windows-amd64")
|
||||
|
||||
# Create the dist directory if it doesnt exist
|
||||
mkdir -p dist
|
||||
|
||||
for PLATFORM in "${PLATFORMS[@]}"; do
|
||||
# Extract the GOOS and GOARCH values from the platform string
|
||||
GOOS=${PLATFORM%%-*}
|
||||
GOARCH=${PLATFORM##*-}
|
||||
echo "Building for $GOOS/$GOARCH..."
|
||||
|
||||
# Set the GOOS and GOARCH environment variables
|
||||
export GOOS
|
||||
export GOARCH
|
||||
|
||||
# Determine the binary extension based on the target OS
|
||||
BIN_EXT=""
|
||||
if [[ "$GOOS" == "windows" ]]; then
|
||||
BIN_EXT=".exe"
|
||||
fi
|
||||
|
||||
# Build the executable
|
||||
go build -o "dist/JSONUIHELPER-$GOOS-$GOARCH$BIN_EXT"
|
||||
done
|
||||
|
||||
echo "Build completed."
|
||||
Reference in New Issue
Block a user