migrate to the new tiered structure
This commit is contained in:
26
entrypoint.sh
Executable file
26
entrypoint.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
# This runs every time a container starts. Keep it generic — anything specific
|
||||
# to a project (language versions, installing dependencies, and so on) belongs
|
||||
# in that project's .safeclaude/hooks/, not here.
|
||||
set -e
|
||||
|
||||
# Install Claude if it isn't already here. The home folder is saved between
|
||||
# runs, so this only actually downloads the first time.
|
||||
if ! command -v claude &>/dev/null; then
|
||||
echo "[safeclaude] Claude Code not found — installing..."
|
||||
curl -fsSL https://claude.ai/install.sh | bash
|
||||
fi
|
||||
|
||||
# Run the project's setup scripts, in name order. They're read straight from the
|
||||
# project folder, so editing one takes effect next launch — no rebuild needed.
|
||||
# If a script fails we stop here, rather than start in a half-set-up container.
|
||||
HOOK_DIR="/code/.safeclaude/hooks"
|
||||
if [ -d "$HOOK_DIR" ]; then
|
||||
for hook in "$HOOK_DIR"/*.sh; do
|
||||
[ -e "$hook" ] || continue
|
||||
echo "[safeclaude] hook: $(basename "$hook")"
|
||||
bash "$hook"
|
||||
done
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user