Appease Stickler-bot

So... originally no changes were made to the code, but Stickler-bot was unimpressed, so I've followed its suggestions.

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
This commit is contained in:
Rob Gill 2018-05-29 18:59:55 +10:00 committed by GitHub
parent 1911c3690d
commit ebeab06710
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,10 +57,10 @@ if [ -x "$(command -v rpm)" ]; then
# Fedora Family # Fedora Family
PKG_REMOVE="${PKG_MANAGER} remove -y" PKG_REMOVE="${PKG_MANAGER} remove -y"
package_check() { package_check() {
rpm -qa | grep ^$1- > /dev/null rpm -qa | grep "^$1-" > /dev/null
} }
package_cleanup() { package_cleanup() {
${SUDO} ${PKG_MANAGER} -y autoremove "${SUDO}" "${PKG_MANAGER}" -y autoremove
} }
elif [ -x "$(command -v apt-get)" ]; then elif [ -x "$(command -v apt-get)" ]; then
# Debian Family # Debian Family
@ -69,8 +69,8 @@ elif [ -x "$(command -v apt-get)" ]; then
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed" dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
} }
package_cleanup() { package_cleanup() {
${SUDO} ${PKG_MANAGER} -y autoremove "${SUDO}" "${PKG_MANAGER}" -y autoremove
${SUDO} ${PKG_MANAGER} -y autoclean "${SUDO}" "${PKG_MANAGER}" -y autoclean
} }
else else
echo -e " ${CROSS} OS distribution not supported" echo -e " ${CROSS} OS distribution not supported"
@ -81,8 +81,7 @@ removeAndPurge() {
# Purge dependencies # Purge dependencies
echo "" echo ""
for i in "${DEPS[@]}"; do for i in "${DEPS[@]}"; do
package_check ${i} > /dev/null if package_check "${i}" > /dev/null; then
if [[ "$?" -eq 0 ]]; then
while true; do while true; do
read -rp " ${QST} Do you wish to remove ${COL_WHITE}${i}${COL_NC} from your system? [Y/N] " yn read -rp " ${QST} Do you wish to remove ${COL_WHITE}${i}${COL_NC} from your system? [Y/N] " yn
case ${yn} in case ${yn} in