why do we need a checkmark?
The number itself tells us it was completed
This commit is contained in:
parent
2edea865b0
commit
6105acf78b
2 changed files with 6 additions and 13 deletions
|
|
@ -100,12 +100,12 @@ Installing the nano package as normal:
|
|||
(1/1) checking available disk space [######################################] 100%
|
||||
:: Running pre-transaction hooks...
|
||||
(1/1) Performing snapper pre snapshots...
|
||||
root 1033 ✓
|
||||
root 1033
|
||||
:: Processing package changes...
|
||||
(1/1) installing nano [######################################] 100%
|
||||
:: Running post-transaction hooks...
|
||||
(1/1) Performing snapper post snapshots...
|
||||
root 1034 ✓
|
||||
root 1034
|
||||
|
||||
.EE
|
||||
|
||||
|
|
|
|||
|
|
@ -56,10 +56,6 @@ source "$SNAPPER_CONFIG_FILE"
|
|||
[[ $1 != "pre" ]] && [[ $1 != "post" ]] && [[ $1 != "rem" ]] && die "First argument should either be 'pre', 'post', or 'rem'."
|
||||
[[ -z "$SNAPPER_CONFIGS" ]] && die "No snapper configurations found, so not taking any snapshots!"
|
||||
|
||||
# Only use checkmark if UTF8 is available and we are not in TTY
|
||||
declare checkmark="done"
|
||||
[[ $(awk '/UTF-8|utf8/' <(echo $LANG)) && "$TERM" != "linux" ]] && checkmark="✓"
|
||||
|
||||
declare -r pre_or_post=$1
|
||||
declare pacman_cmd="$(sed 's./usr/bin/pacman.pacman.g' <(ps -C pacman -o args=))"
|
||||
|
||||
|
|
@ -90,21 +86,18 @@ for CONFIG in $SNAPPER_CONFIGS; do
|
|||
|
||||
x=$((x+1))
|
||||
|
||||
printf " %s " "$CONFIG"
|
||||
case "$pre_or_post" in
|
||||
pre)
|
||||
printf " %s " "$CONFIG"
|
||||
$snapper_cmd --description "$(truncate_description $PACMAN_PRE_DESCRIPTION)" > "$prefile"
|
||||
printf "%s %s\n" "$(< "$prefile")" "$checkmark"
|
||||
printf "$($snapper_cmd --description "$(truncate_description $PACMAN_PRE_DESCRIPTION)" | tee "$prefile")\n"
|
||||
;;
|
||||
post)
|
||||
if [[ -f $prefile ]]; then
|
||||
printf " %s " "$CONFIG"
|
||||
postnum=$($snapper_cmd --description "$(truncate_description $PACMAN_POST_DESCRIPTION)" --pre-number "$(< "$prefile")")
|
||||
printf "%s %s\n" "$postnum" "$checkmark"
|
||||
rm "$prefile"
|
||||
printf "$($snapper_cmd --description "$(truncate_description $PACMAN_POST_DESCRIPTION)" --pre-number "$(< "$prefile")")\n"
|
||||
else
|
||||
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
|
||||
rm -f "$prefile"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue