forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscala
executable file
·38 lines (31 loc) · 804 Bytes
/
scala
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
#!/usr/bin/env bash
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.."
scala_args() {
declare -a CLI_ARGS
declare -a SCRIPT_ARGS
declare DISABLE_BLOOP=1
while (( "$#" )); do
case "$1" in
"--")
shift
SCRIPT_ARGS+=("--")
SCRIPT_ARGS+=("$@")
break
;;
"clean" | "version" | "--version" | "-version" | "help" | "--help" | "-help")
CLI_ARGS+=("$1")
DISABLE_BLOOP=0 # clean command should not add --offline --server=false
shift
;;
*)
CLI_ARGS+=("$1")
shift
;;
esac
done
if [ $DISABLE_BLOOP -eq 1 ]; then
CLI_ARGS+=("--offline" "--server=false")
fi
echo "--power ${CLI_ARGS[@]} ${SCRIPT_ARGS[@]}"
}
"$ROOT/bin/common" "scala" $(scala_args "$@")