Described all the code, added a build

This commit is contained in:
2024-09-13 21:24:03 +03:00
parent 06fcdaacd4
commit 8d6e6f3c4b
2 changed files with 45 additions and 8 deletions

29
build.sh Executable file
View 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."