forked from nikitabobko/AeroSpace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-cli.sh
executable file
·19 lines (16 loc) · 712 Bytes
/
run-cli.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
# set -e # Exit if one of commands exit with non-zero exit code
set -u # Treat unset variables and parameters other than the special parameters ‘@’ or ‘*’ as an error
set -o pipefail # Any command failed in the pipe fails the whole pipe
# set -x # Print shell commands as they are executed (or you can try -v which is less verbose)
# I'd not need this script if `swift run` wasn't that damn slow compared to `swift build`!
# https://forums.swift.org/t/swift-run-really-slow/67807/12
cd "$(dirname "$0")"
cd ./LocalPackage
output="$(swift build)"
if [ $? -ne 0 ]; then
echo "$output"
exit 1
fi
cd - > /dev/null
./LocalPackage/.build/debug/aerospace "$@"