Skip to content

Commit 632fddb

Browse files
committed
fix error output when no commit template exists
1 parent be2904b commit 632fddb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

git-coauthor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function solo() {
8282
}
8383

8484
function display_current() {
85-
local -r authors="$(cat "${COMMIT_TEMPLATE}" | grep 'Co-authored-by:' | cut -d':' -f2)"
85+
local -r authors="$(grep 'Co-authored-by:' "${COMMIT_TEMPLATE}" 2>/dev/null | cut -d':' -f2)"
8686
echo "CURRENT CO-AUTHORS"
8787
if [[ -z "${authors}" ]]; then
8888
echo "You're committing solo!"

0 commit comments

Comments
 (0)