-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.sh
executable file
·37 lines (34 loc) · 1.03 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
#!/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