mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-08 15:14:49 +03:00
;bin: hledger-git: record: better error output
This commit is contained in:
parent
ae26ae6294
commit
a37da26ee9
@ -76,12 +76,12 @@ record() {
|
|||||||
ensure_git
|
ensure_git
|
||||||
ensure_git_repo
|
ensure_git_repo
|
||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
for F in $FILES; do $GIT add "$F"; done || echo "(ignored)"
|
for F in $FILES; do $GIT add "$F"; done || echo "(ignored)" >&2
|
||||||
MSG=${1:-$(date +'%Y-%m-%d %H:%M:%S %Z')}
|
MSG=${1:-$(date +'%Y-%m-%d %H:%M:%S %Z')}
|
||||||
if [ $# -ge 1 ]; then
|
if [ $# -ge 1 ]; then
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
$GIT commit -m "$MSG" "$@" || $GIT reset
|
$GIT commit -m "$MSG" "$@" || (echo "error: commit failed" >&2; $GIT reset -q)
|
||||||
}
|
}
|
||||||
r() { record "$@"; }
|
r() { record "$@"; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user