Check exit code directly (SC2181)
This commit is contained in:
parent
2033e5673e
commit
635468b707
1 changed files with 2 additions and 4 deletions
6
yadm
6
yadm
|
@ -221,8 +221,7 @@ function decrypt() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#; decrypt the archive
|
#; decrypt the archive
|
||||||
($GPG_PROGRAM -d "$YADM_ARCHIVE" || echo 1) | tar v${tar_option}f - -C "$YADM_WORK"
|
if ($GPG_PROGRAM -d "$YADM_ARCHIVE" || echo 1) | tar v${tar_option}f - -C "$YADM_WORK"; then
|
||||||
if [ $? = 0 ] ; then
|
|
||||||
[ ! "$DO_LIST" = "YES" ] && echo "All files decrypted."
|
[ ! "$DO_LIST" = "YES" ] && echo "All files decrypted."
|
||||||
else
|
else
|
||||||
error_out "Unable to extract encrypted files."
|
error_out "Unable to extract encrypted files."
|
||||||
|
@ -269,8 +268,7 @@ function encrypt() {
|
||||||
echo
|
echo
|
||||||
|
|
||||||
#; encrypt all files which match the globs
|
#; encrypt all files which match the globs
|
||||||
tar -f - -c "${GLOBS[@]}" | $GPG_PROGRAM --yes "${GPG_OPTS[@]}" --output "$YADM_ARCHIVE"
|
if tar -f - -c "${GLOBS[@]}" | $GPG_PROGRAM --yes "${GPG_OPTS[@]}" --output "$YADM_ARCHIVE"; then
|
||||||
if [ $? = 0 ]; then
|
|
||||||
echo "Wrote new file: $YADM_ARCHIVE"
|
echo "Wrote new file: $YADM_ARCHIVE"
|
||||||
else
|
else
|
||||||
error_out "Unable to write $YADM_ARCHIVE"
|
error_out "Unable to write $YADM_ARCHIVE"
|
||||||
|
|
Loading…
Reference in a new issue