mirror of
https://github.com/usememos/memos.git
synced 2025-03-04 09:19:09 +08:00
29 lines
624 B
Bash
Executable file
29 lines
624 B
Bash
Executable file
#!/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/memos.exe"
|
|
else
|
|
OUTPUT="./build/memos"
|
|
fi
|
|
|
|
echo "Building for $OS..."
|
|
|
|
# Build the executable
|
|
go build -o "$OUTPUT" ./bin/memos/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"
|