#!/bin/bash

Rscript -e "if (!requireNamespace('captain', quietly = TRUE)) { cat('❌ captain package is not installed.\n'); quit(save = 'no', status = 1, runLast = FALSE) }; captain::run_precommit()"

STATUS=$?

if [ $STATUS -eq 0 ]; then
  echo "✅ All hooks passed."
  exit 0
else
  echo "❌ Some hooks failed. Aborting commit."
  exit 1
fi
