-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·36 lines (34 loc) · 882 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Function to build the application for Linux or macOS
build_for_os() {
case "$1" in
linux)
echo "Building for Linux..."
GOOS=linux GOARCH=amd64 go build -o dockermi main.go
echo "Build completed! The executable is dockermi-linux."
;;
darwin)
echo "Building for macOS..."
GOOS=darwin GOARCH=amd64 go build -o dockermi main.go
echo "Build completed! The executable is dockermi-macos."
;;
*)
echo "Unsupported operating system: $1"
exit 1
;;
esac
}
# Detect the operating system
OS="$(uname -s)"
case "$OS" in
Linux)
build_for_os linux
;;
Darwin)
build_for_os darwin
;;
*)
echo "This script only supports Linux and macOS."
exit 1
;;
esac