mirror of
https://github.com/SHOGGOTH-SECTOR/sica-fondt.git
synced 2026-07-31 08:06:26 +00:00
chore: add SessionStart hook to install R + Octave for web sessions
Installs r-base-core (Drive-Box R drivers/tests) and octave (ETR torus tests) in Claude Code on the web. Synchronous, idempotent, remote-only; skips packages already present. Ada/Alire left out by design. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c
This commit is contained in:
parent
80791084a4
commit
c53a92d811
31
.claude/hooks/session-start.sh
Executable file
31
.claude/hooks/session-start.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# SessionStart hook — install the endocrine toolchains so the project's tests run
|
||||||
|
# in Claude Code on the web:
|
||||||
|
# * R (Rscript) -> the Drive-Box drivers + tests (src/endocrine/*.R)
|
||||||
|
# * GNU Octave -> the ETR torus + tests (src/endocrine/etr/*.m)
|
||||||
|
#
|
||||||
|
# Synchronous + idempotent (safe to re-run; installs only what's missing).
|
||||||
|
# Ada/Alire (mafiabot_core) is intentionally NOT installed here: it is not an apt
|
||||||
|
# package (the CI uses the setup-alire action) and its CI is scheduled-only. Add
|
||||||
|
# it if you want web sessions to build/test the Ada side.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Only do the heavy apt install in the remote (web) environment.
|
||||||
|
if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
pkgs=()
|
||||||
|
command -v Rscript >/dev/null 2>&1 || pkgs+=(r-base-core)
|
||||||
|
command -v octave >/dev/null 2>&1 || pkgs+=(octave)
|
||||||
|
|
||||||
|
if [ "${#pkgs[@]}" -gt 0 ]; then
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install -y --no-install-recommends "${pkgs[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Surface versions in the session log (non-fatal).
|
||||||
|
command -v Rscript >/dev/null 2>&1 && Rscript --version 2>&1 | head -1 || true
|
||||||
|
command -v octave-cli >/dev/null 2>&1 && octave-cli --version 2>&1 | head -1 || true
|
||||||
14
.claude/settings.json
Normal file
14
.claude/settings.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"SessionStart": [
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user