dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README

commit 5ec5610f597d3f8f5f391e0cd6af3ae4fa2650ba
parent 2d16799006fe8185129f5c23bbf20e736ff34291
Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe>
Date:   Wed,  5 Jun 2024 23:51:41 -0500

bash: return error code in git function

Diffstat:
M.config/shell/functions.sh | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/.config/shell/functions.sh b/.config/shell/functions.sh @@ -49,9 +49,11 @@ git() { if [ -n "${_work_tree}" ]; then set -- --work-tree "${_work_tree}" "$@" fi - command git "$@" unset _git_dir _work_tree + command git "$@" + return $? fi + return 1 } print_goodbye() { @@ -64,7 +66,7 @@ print_goodbye() { # shellcheck disable=SC2016 if [ -z "${TMUX}" ] && { [ -n "$(dotfiles ls-files "$@" || true)" ] || - ! dotfiles submodule foreach '[ -z "$(git ls-files "$@")" ]' \ + ! dotfiles submodule foreach '[ -z "$(git ls-files '"$*"')" ]' \ >/dev/null 2>/dev/null; }; then echo "In dotfiles:"