Skip to content
Open
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
6 changes: 5 additions & 1 deletion cli/assets/hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
set -eu

# >>> sce managed block (do not edit) >>>
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
Expand All @@ -25,4 +26,7 @@ if ! command -v sce >/dev/null 2>&1; then
exit 0
fi

exec sce hooks commit-msg "$@"
sce hooks commit-msg "$@"
status=$?
exit "$status"
# <<< sce managed block <<<
14 changes: 9 additions & 5 deletions cli/assets/hooks/post-commit
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/sh
set -eu

remote_url="$(git remote get-url origin 2>/dev/null || true)"

# >>> sce managed block (do not edit) >>>
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
Expand All @@ -27,8 +26,13 @@ if ! command -v sce >/dev/null 2>&1; then
exit 0
fi

remote_url="$(git remote get-url origin 2>/dev/null || true)"

if [ -n "$remote_url" ]; then
exec sce hooks post-commit --vcs git --remote-url "$remote_url" "$@"
sce hooks post-commit --vcs git --remote-url "$remote_url" "$@"
else
sce hooks post-commit --vcs git "$@"
fi

exec sce hooks post-commit --vcs git "$@"
status=$?
exit "$status"
# <<< sce managed block <<<
6 changes: 5 additions & 1 deletion cli/assets/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
set -eu

# >>> sce managed block (do not edit) >>>
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
Expand All @@ -25,4 +26,7 @@ if ! command -v sce >/dev/null 2>&1; then
exit 0
fi

exec sce hooks pre-commit "$@"
sce hooks pre-commit "$@"
status=$?
exit "$status"
# <<< sce managed block <<<
Loading
Loading