From 2edea865b0df4df58ef3e808dcce74f85ac95765 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Tue, 14 Feb 2017 09:05:04 -0600 Subject: [PATCH] removal should be checked first in loop --- scripts/snap-pac | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/snap-pac b/scripts/snap-pac index 1862584..8166efd 100755 --- a/scripts/snap-pac +++ b/scripts/snap-pac @@ -71,6 +71,8 @@ fi declare -i x=0 for CONFIG in $SNAPPER_CONFIGS; do + [[ "$pre_or_post" == "rem" ]] && rm -f "$prefile" && continue + # Set defaults PACMAN_PRE_POST="no" [[ $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" fi ;; - rem) - rm -f "$prefile" - ;; esac done [[ $x -eq 0 ]] && die "No snapper configurations are set up for snapshots to be taken!" - -exit 0