removal should be checked first in loop

This commit is contained in:
James Barnett 2017-02-14 09:05:04 -06:00
parent 5011637263
commit 2edea865b0
No known key found for this signature in database
GPG key ID: E4B5E45AA3B8C5C3

View file

@ -71,6 +71,8 @@ fi
declare -i x=0 declare -i x=0
for CONFIG in $SNAPPER_CONFIGS; do for CONFIG in $SNAPPER_CONFIGS; do
[[ "$pre_or_post" == "rem" ]] && rm -f "$prefile" && continue
# Set defaults # Set defaults
PACMAN_PRE_POST="no" PACMAN_PRE_POST="no"
[[ $CONFIG == "root" ]] && PACMAN_PRE_POST="yes" [[ $CONFIG == "root" ]] && PACMAN_PRE_POST="yes"
@ -104,13 +106,8 @@ for CONFIG in $SNAPPER_CONFIGS; do
warning "%s does not exist, so no post snapshot for %s will be taken. If you are initially installing snap-pac, this is normal." "$prefile" "$CONFIG" warning "%s does not exist, so no post snapshot for %s will be taken. If you are initially installing snap-pac, this is normal." "$prefile" "$CONFIG"
fi fi
;; ;;
rem)
rm -f "$prefile"
;;
esac esac
done done
[[ $x -eq 0 ]] && die "No snapper configurations are set up for snapshots to be taken!" [[ $x -eq 0 ]] && die "No snapper configurations are set up for snapshots to be taken!"
exit 0