mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-27 04:13:11 +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_repo
|
||||
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')}
|
||||
if [ $# -ge 1 ]; then
|
||||
shift
|
||||
fi
|
||||
$GIT commit -m "$MSG" "$@" || $GIT reset
|
||||
$GIT commit -m "$MSG" "$@" || (echo "error: commit failed" >&2; $GIT reset -q)
|
||||
}
|
||||
r() { record "$@"; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user