-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·50 lines (40 loc) · 1014 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -eo pipefail
# Import common functions
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=./common.sh
source "$DIR/common.sh"
USAGE="Usage: $0 [OPTIONS]
Build all Rust binaries.
OPTIONS: All options are optional
--help
Display these instructions.
--verbose
Display commands being executed."
while [ $# -gt 0 ]; do
case "$1" in
--help)
echo "$USAGE"
exit 1
;;
--verbose)
set -x
;;
esac
shift
done
if [ -z "$(command -v cargo)" ]; then
print_error_and_exit "Cargo not found in path. Maybe install rustup?"
fi
cd "$REPO_ROOT"
print_magenta "Building binaries..."
cargo build --release --bins
executables=$(get_rust_executable_names)
for executable in $executables; do
print_green "${executable%.exe}"
rm -f "$executable"
mv ./target/release/"$executable" "$executable"
./"$executable" --version
./"$executable" -h || :
echo ""
done