-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmagew
More file actions
executable file
·42 lines (38 loc) · 967 Bytes
/
magew
File metadata and controls
executable file
·42 lines (38 loc) · 967 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
target="${1:-}"
usage() {
cat <<'USAGE'
Usage: ./magew [target]
Targets:
ci:debug Run full CI debug parity lane
ci:preflight Run CI preflight checks
launch:verify Alias of ci:debug
USAGE
}
case "${target}" in
-l|--list)
printf '%-20s %s\n' "ci:debug" "Run full CI debug parity lane"
printf '%-20s %s\n' "ci:preflight" "Run CI preflight checks"
printf '%-20s %s\n' "launch:verify" "Alias of ci:debug"
;;
-h|--help|"")
usage
exit 2
;;
ci:debug|launch:verify)
if [[ -f "${repo_root}/package.json" ]] && command -v npm >/dev/null 2>&1; then
exec npm run ci:debug --silent
fi
exec bash "${repo_root}/scripts/ci/debug.sh"
;;
ci:preflight)
exec bash "${repo_root}/scripts/ci/preflight.sh"
;;
*)
printf 'ERROR: unknown target: %s\n' "${target}" >&2
usage >&2
exit 2
;;
esac