diff options
-rw-r--r-- | lib/keyringer/functions | 4 | ||||
-rwxr-xr-x | share/keyringer/append | 6 | ||||
-rwxr-xr-x | share/keyringer/encrypt | 8 |
3 files changed, 18 insertions, 0 deletions
diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 129ec0e..1d29157 100644 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -74,6 +74,10 @@ function keyringer_exec { # Dispatch if keyringer_has_action "$action"; then "$ACTIONS/$action" "$basedir" $* + err="$?" + if [ "$err" != "0" ]; then + exit "$err" + fi fi } diff --git a/share/keyringer/append b/share/keyringer/append index 045ba86..bcc9e5e 100755 --- a/share/keyringer/append +++ b/share/keyringer/append @@ -32,4 +32,10 @@ for element in $(seq 0 $((${#NEW[@]} - 1))); do echo ${NEW[$element]} done | keyringer_exec encrypt-batch $BASEDIR $FILE +err="$?" + +if [ "$err" != "0" ]; then + exit "$err" +fi + IFS="$OLDIFS" diff --git a/share/keyringer/encrypt b/share/keyringer/encrypt index da0941f..3680d0b 100755 --- a/share/keyringer/encrypt +++ b/share/keyringer/encrypt @@ -23,7 +23,15 @@ fi $GPG --use-agent --armor -e -s $(keyringer_recipients "$RECIPIENTS_FILE") - > "$KEYDIR/$FILE" +err="$?" + +if [ "$err" != "0" ]; then + exit "$err" +fi + # Stage if [ -d "$BASEDIR/.git" ]; then keyringer_exec git "$BASEDIR" add "keys/$FILE" fi + +exit "$?" |