-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
executable file
·26 lines (23 loc) · 973 Bytes
/
install.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
#!/bin/sh
echo "*** Cleaning"
swift package reset
echo "*** Building"
if [ "$(uname)" == "Darwin" ]; then
swift build -c release --arch arm64 --arch x86_64 -Xswiftc -O -Xswiftc -Ounchecked -Xswiftc -whole-module-optimization -Xswiftc -enforce-exclusivity=unchecked -Xlinker -dead_strip
SRC="$(swift build -c release --arch arm64 --arch x86_64 --show-bin-path)/trailer"
else
swift build -c release -Xswiftc -O -Xswiftc -Ounchecked -Xswiftc -whole-module-optimization -Xswiftc -enforce-exclusivity=unchecked -Xlinker -dead_strip
SRC="$(swift build -c release --show-bin-path)/trailer"
fi
if [ $? -eq 0 ]; then
echo "*** Stripping symbols"
strip $SRC
echo "*** Installing 'trailer' to /usr/local/bin, please enter your sudo password if needed"
sudo install $SRC /usr/local/bin/trailer
echo "*** Cleaning Up"
swift package reset
echo "*** Done"
else
echo
echo "*** Build failed, ensure you are using Swift 5.x on the command line"
fi