mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 13:22:28 +00:00
Add command_exists for snap
This commit is contained in:
parent
26d0adc829
commit
0e14d3a9db
|
@ -3,6 +3,7 @@
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
|
||||||
removeSnaps() {
|
removeSnaps() {
|
||||||
|
if command_exists snap; then
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Rns snapd
|
"$ESCALATION_TOOL" "$PACKAGER" -Rns snapd
|
||||||
|
@ -13,10 +14,7 @@ removeSnaps() {
|
||||||
"$ESCALATION_TOOL" apt-mark hold snapd
|
"$ESCALATION_TOOL" apt-mark hold snapd
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf|zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
|
||||||
;;
|
|
||||||
zypper)
|
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
"$ESCALATION_TOOL" "$PACKAGER" remove snapd
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -24,6 +22,10 @@ removeSnaps() {
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
printf "%b\n" "${GREEN}Successfully removed snaps...${RC}"
|
||||||
|
else
|
||||||
|
printf "%b\n" "${GREEN}Snap is not installed...${RC}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
|
|
Loading…
Reference in New Issue
Block a user