Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
kiss: Block Ctrl+C during removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanaraps committed Jul 4, 2019
1 parent 55c1ea6 commit da0f1fd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions kiss
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,11 @@ pkg_remove() {
die "[$1]: Package is required by ${required_by%, }." \
"[$1]: Aborting here..."

# Block being able to abort the script with 'Ctrl+C' during installation.
# Removes all risk of the user aborting a package installation leaving
# an incomplete package installed.
trap '' INT

while read -r file; do
# The file is in '/etc' skip it. This prevents the package
# manager from removing user edited configuration files.
Expand All @@ -596,6 +601,10 @@ pkg_remove() {
fi
done < "$KISS_ROOT/var/db/kiss/$1/manifest"

# Reset 'trap' to its original value. Installation is done so
# we no longer need to block 'Ctrl+C'.
trap pkg_clean EXIT INT

log "[$1]: Removed successfully."
}

Expand Down

0 comments on commit da0f1fd

Please sign in to comment.