-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathsetup
More file actions
executable file
·108 lines (99 loc) · 2.38 KB
/
setup
File metadata and controls
executable file
·108 lines (99 loc) · 2.38 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
INSTALL_SKILLS=0
INSTALL_ARGS=()
print_help() {
cat <<'EOF'
Usage: ./setup [options]
Prepare the repo-local CLI and development environment.
Options:
--install-skills Install skills after setup completes
--with-phases With --install-skills, install the full skill family
--target-dir <path> Pass through to npm run install:skills
--skill <name> Pass through to npm run install:skills
--mode <copy|link> Pass through to npm run install:skills
-h, --help Show this help message
Examples:
./setup
./setup --install-skills
./setup --install-skills --with-phases
EOF
}
while [[ $# -gt 0 ]]; do
case "$1" in
--install-skills)
INSTALL_SKILLS=1
shift
;;
--with-phases)
INSTALL_SKILLS=1
INSTALL_ARGS+=("$1")
shift
;;
--target-dir)
INSTALL_SKILLS=1
INSTALL_ARGS+=("$1")
shift
if [[ $# -eq 0 ]]; then
echo "Missing value for --target-dir" >&2
exit 1
fi
INSTALL_ARGS+=("$1")
shift
;;
--skill)
INSTALL_SKILLS=1
INSTALL_ARGS+=("$1")
shift
if [[ $# -eq 0 ]]; then
echo "Missing value for --skill" >&2
exit 1
fi
INSTALL_ARGS+=("$1")
shift
;;
--mode)
INSTALL_SKILLS=1
INSTALL_ARGS+=("$1")
shift
if [[ $# -eq 0 ]]; then
echo "Missing value for --mode" >&2
exit 1
fi
INSTALL_ARGS+=("$1")
shift
;;
-h|--help)
print_help
exit 0
;;
*)
echo "Unknown argument: $1" >&2
echo >&2
print_help >&2
exit 1
;;
esac
done
cd "$ROOT_DIR"
npm ci
npm run build
npm run doctor
if [[ "$INSTALL_SKILLS" -eq 1 ]]; then
npm run install:skills -- "${INSTALL_ARGS[@]}"
fi
echo
echo "Setup complete."
echo "Repo-local CLI: ./event-tracking --help"
echo "Installed command name: event-tracking"
if [[ "$INSTALL_SKILLS" -eq 1 ]]; then
if [[ "${#INSTALL_ARGS[@]}" -eq 0 ]]; then
echo "Codex skills installed via: npm run install:skills"
else
echo "Codex skills installed via: npm run install:skills -- ${INSTALL_ARGS[*]}"
fi
else
echo "To install the umbrella skill later: npm run install:skills"
echo "To install the full skill family later: npm run install:skills -- --with-phases"
fi