mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 05:12:27 +00:00
Add command_exists for snap
This commit is contained in:
parent
26d0adc829
commit
0e14d3a9db
|
@ -3,27 +3,29 @@
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
removeSnaps() {
|
removeSnaps() {
|
||||||
case "$PACKAGER" in
|
if command_exists snap; then
|
||||||
pacman)
|
case "$PACKAGER" in
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Rns snapd
|
pacman)
|
||||||
;;
|
"$ESCALATION_TOOL" "$PACKAGER" -Rns snapd
|
||||||
apt-get|nala)
|
;;
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" autoremove --purge snapd
|
apt-get|nala)
|
||||||
if [ "$ID" = ubuntu ]; then
|
"$ESCALATION_TOOL" "$PACKAGER" autoremove --purge snapd
|
||||||
"$ESCALATION_TOOL" apt-mark hold snapd
|
if [ "$ID" = ubuntu ]; then
|
||||||
fi
|
"$ESCALATION_TOOL" apt-mark hold snapd
|
||||||
;;
|
fi
|
||||||
dnf)
|
;;
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
dnf|zypper)
|
||||||
;;
|
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
||||||
zypper)
|
;;
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
*)
|
||||||
;;
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
*)
|
exit 1
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
;;
|
||||||
exit 1
|
esac
|
||||||
;;
|
printf "%b\n" "${GREEN}Successfully removed snaps...${RC}"
|
||||||
esac
|
else
|
||||||
|
printf "%b\n" "${GREEN}Snap is not installed...${RC}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
|
|
Loading…
Reference in New Issue
Block a user