diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-02 22:15:59 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-02 22:15:59 +1300 |
commit | c8a6cba61697c02ecc2e3c5db27629630d9fade2 (patch) | |
tree | dc4065262c4e3215b10698b7a099151660829fb4 /bash/bashrc.d | |
parent | Add missing source of helper func to man complete (diff) | |
download | dotfiles-c8a6cba61697c02ecc2e3c5db27629630d9fade2.tar.gz dotfiles-c8a6cba61697c02ecc2e3c5db27629630d9fade2.zip |
Move error increment to outside of if block
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/keep.bash | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/bash/bashrc.d/keep.bash b/bash/bashrc.d/keep.bash index a39d2fa7..2eebdae3 100644 --- a/bash/bashrc.d/keep.bash +++ b/bash/bashrc.d/keep.bash @@ -101,19 +101,17 @@ EOF # If -d was given, delete the keep files for the NAME if ((delete)) ; then - rm -- "$bashkeep"/"$name".bash || - ((errors++)) + rm -- "$bashkeep"/"$name".bash # Save a function elif [[ $(type -t "$name") = 'function' ]] ; then - declare -f -- "$name" >"$bashkeep"/"$name".bash || - ((errors++)) + declare -f -- "$name" >"$bashkeep"/"$name".bash # Save a variable elif declare -p -- "$name" >/dev/null ; then - declare -p -- "$name" >"$bashkeep"/"$name".bash || - ((errors++)) - fi + declare -p -- "$name" >"$bashkeep"/"$name".bash + + fi || ((errors++)) ;; esac done |