more refactoring

This commit is contained in:
James Barnett 2017-02-14 11:13:36 -06:00
parent 1969e5bd15
commit ea299e2b8a
No known key found for this signature in database
GPG key ID: E4B5E45AA3B8C5C3

View file

@ -87,18 +87,14 @@ for CONFIG in $SNAPPER_CONFIGS; do
x=$((x+1))
printf "==> %s " "$CONFIG"
case "$pre_or_post" in
pre) printf "$($snapper_cmd "$(truncate_description $PACMAN_PRE_DESCRIPTION)" | tee "$prefile")\n" ;;
post)
if [[ -f $prefile ]]; then
printf "$($snapper_cmd "$(truncate_description $PACMAN_POST_DESCRIPTION)" --pre-number "$(< "$prefile")")\n"
if [[ "$pre_or_post" == "pre" ]]; then
printf "==> %s $($snapper_cmd "$(truncate_description $PACMAN_PRE_DESCRIPTION)" | tee "$prefile")\n" "$CONFIG"
elif [[ -f $prefile && "$pre_or_post" == "post" ]]; then
printf "==> %s $($snapper_cmd "$(truncate_description $PACMAN_POST_DESCRIPTION)" --pre-number "$(< "$prefile")")\n" "$CONFIG"
rm -f "$prefile"
else
elif [[ ! -f $prefile && "$pre_or_post" == "post" ]]; then
warning "%s does not exist, so no post snapshot for %s will be taken. If you are initially installing $name, this is normal." "$prefile" "$CONFIG"
fi
;;
esac
done