make if logic clearer
This commit is contained in:
parent
f0ddb4ee29
commit
54df716ec1
1 changed files with 14 additions and 9 deletions
|
|
@ -137,16 +137,21 @@ for CONFIG in $SNAPPER_CONFIGS; do
|
||||||
|
|
||||||
if [[ "$pre_or_post" == "pre" ]]; then
|
if [[ "$pre_or_post" == "pre" ]]; then
|
||||||
$snapper_cmd --description "$PACMAN_PRE_DESCRIPTION" --print-number > "$prefile"
|
$snapper_cmd --description "$PACMAN_PRE_DESCRIPTION" --print-number > "$prefile"
|
||||||
printf "%s %s\n" "$(< "$prefile")" "$checkmark"
|
printf " %s %s %s\n" "$CONFIG" "$(< "$prefile")" "$checkmark"
|
||||||
elif [[ "$pre_or_post" == "rem" && -f "$prefile" ]]; then
|
elif [[ "$pre_or_post" == "rem" ]]; then
|
||||||
printf "N/A\n"
|
printf "N/A\n"
|
||||||
rm "$prefile"
|
if [[ -f $prefile ]]; then
|
||||||
elif [[ -f $prefile ]]; then
|
rm "$prefile"
|
||||||
postnum=$($snapper_cmd --description "$PACMAN_POST_DESCRIPTION" --print-number --pre-number "$(< "$prefile")")
|
fi
|
||||||
printf "%s %s\n" "$postnum" "$checkmark"
|
elif [[ "$pre_or_post" == "post" ]]; then
|
||||||
rm "$prefile"
|
if [[ -f $prefile ]]; then
|
||||||
else
|
postnum=$($snapper_cmd --description "$PACMAN_POST_DESCRIPTION" --print-number --pre-number "$(< "$prefile")")
|
||||||
printf "%b %s does not exist, so no post snapshot will be taken. If you are initially installing snap-pac, this is normal.\n" "$WARNINGMSG" "$prefile"
|
printf "%s %s\n" "$postnum" "$checkmark"
|
||||||
|
rm "$prefile"
|
||||||
|
else
|
||||||
|
printf "N/A\n"
|
||||||
|
printf " %b %s does not exist, so no post snapshot for %s will be taken. If you are initially installing snap-pac, this is normal.\n" "$WARNINGMSG" "$prefile" "$CONFIG"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue