Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cli/assets/hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
#!/bin/sh
set -eu

if ! command -v sce >/dev/null 2>&1; then
# sce brand colors — only emit ANSI when stderr is a real terminal
if [ -t 2 ]; then
RED="$(printf '\033[38;2;220;38;38m')" # red #dc2626
G="$(printf '\033[38;2;5;150;105m')" # brand green #059669
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

exec sce hooks commit-msg "$@"
21 changes: 20 additions & 1 deletion cli/assets/hooks/post-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,26 @@ set -eu
remote_url="$(git remote get-url origin 2>/dev/null || true)"

if ! command -v sce >/dev/null 2>&1; then
echo "sce CLI not found. Install it from https://sce.crocoder.dev/docs/getting-started#install-cli" >&2
# sce brand colors — only emit ANSI when stderr is a real terminal
if [ -t 2 ]; then
RED="$(printf '\033[38;2;220;38;38m')" # red #dc2626
G="$(printf '\033[38;2;5;150;105m')" # brand green #059669
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

Expand Down
24 changes: 24 additions & 0 deletions cli/assets/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
#!/bin/sh
set -eu

if ! command -v sce >/dev/null 2>&1; then
# sce brand colors — only emit ANSI when stderr is a real terminal
if [ -t 2 ]; then
RED="$(printf '\033[38;2;220;38;38m')" # red #dc2626
G="$(printf '\033[38;2;5;150;105m')" # brand green #059669
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

exec sce hooks pre-commit "$@"
8 changes: 4 additions & 4 deletions context/context-map.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 113 additions & 0 deletions context/plans/fix-git-hook-cli-guidance.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading