set -eu
remote_url="$(git remote get-url origin 2>/dev/null || true)"
if ! command -v sce >/dev/null 2>&1; then
if [ -t 2 ]; then
RED="$(printf '\033[38;2;220;38;38m')" G="$(printf '\033[38;2;5;150;105m')" BOLD="$(printf '\033[1m')"
R="$(printf '\033[0m')"
else
RED='' G='' BOLD='' R=''
fi
url="https://sce.crocoder.dev/docs/getting-started#install-cli"
{
printf '\n'
printf ' %s%sā%s %ssce CLI not found%s\n' "$BOLD" "$RED" "$R" "$BOLD" "$R"
printf ' %sā%s Install it from:\n' "$G" "$R"
printf ' %s%s%s%s\n' "$BOLD" "$RED" "$url" "$R"
printf '\n'
} >&2
exit 0
fi
if [ -n "$remote_url" ]; then
exec sce hooks post-commit --vcs git --remote-url "$remote_url" "$@"
fi
exec sce hooks post-commit --vcs git "$@"