mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
624 B
Bash
30 lines
624 B
Bash
1 month ago
|
#!/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"
|