Skip to content

Commit 4909a32

Browse files
committed
Add bin/setup for development deps
1 parent 2ec28ca commit 4909a32

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

bin/setup

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5+
cd "$ROOT_DIR"
6+
7+
run_cmd() {
8+
if [[ -x "$ROOT_DIR/bin/conductor-exec" ]]; then
9+
"$ROOT_DIR/bin/conductor-exec" "$@"
10+
else
11+
"$@"
12+
fi
13+
}
14+
15+
ensure_tool() {
16+
local tool="$1"
17+
if ! run_cmd "$tool" --version >/dev/null 2>&1; then
18+
echo "Error: $tool is not available. Install it and run bin/setup again." >&2
19+
exit 1
20+
fi
21+
}
22+
23+
echo "Checking required tools..."
24+
ensure_tool ruby
25+
ensure_tool bundle
26+
ensure_tool node
27+
ensure_tool yarn
28+
29+
echo "Installing Ruby dependencies..."
30+
run_cmd bundle install
31+
32+
echo "Installing JavaScript dependencies..."
33+
run_cmd yarn install
34+
35+
echo "Development dependencies installed."
36+
echo "Optional: run 'npx husky' to enable local git hooks."

0 commit comments

Comments
 (0)