-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-dev.sh
More file actions
executable file
·72 lines (61 loc) · 1.43 KB
/
install-dev.sh
File metadata and controls
executable file
·72 lines (61 loc) · 1.43 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env sh
set -eu
resolve_self_path() {
if [ -n "${ZSH_VERSION:-}" ]; then
eval 'printf "%s\n" "${(%):-%N}"'
return 0
fi
if [ -n "${BASH_VERSION:-}" ] && [ -n "${BASH_SOURCE:-}" ]; then
printf '%s\n' "${BASH_SOURCE[0]}"
return 0
fi
printf '%s\n' "$0"
}
finish() {
exit_code="$1"
return "$exit_code" 2>/dev/null || exit "$exit_code"
}
is_sourced() {
if [ -n "${ZSH_VERSION:-}" ]; then
case "${ZSH_EVAL_CONTEXT:-}" in
*:file) return 0 ;;
esac
return 1
fi
if [ -n "${BASH_VERSION:-}" ]; then
if eval '[ "${BASH_SOURCE[0]}" != "$0" ]'; then
return 0
fi
fi
return 1
}
refresh_current_shell() {
if [ -n "${ZSH_VERSION:-}" ]; then
rehash >/dev/null 2>&1 || true
return 0
fi
if [ -n "${BASH_VERSION:-}" ]; then
hash -r 2>/dev/null || true
return 0
fi
}
SELF_PATH=$(resolve_self_path)
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$SELF_PATH")" && pwd)
INSTALLER="$SCRIPT_DIR/install.sh"
if [ ! -x "$INSTALLER" ]; then
printf 'install-dev.sh: expected executable installer at %s\n' "$INSTALLER" >&2
finish 1
fi
"$INSTALLER" --dev-only "$@"
if is_sourced; then
refresh_current_shell
fi
if command -v foundry-cmgo-dev >/dev/null 2>&1; then
printf 'foundry-cmgo-dev is ready: %s\n' "$(command -v foundry-cmgo-dev)"
fi
if is_sourced; then
printf 'current shell refreshed\n'
else
printf 'open a new shell if foundry-cmgo-dev is not visible yet\n'
fi
finish 0