#!/usr/bin/env sh

uninstall_zsh_user() {
 local zsh_comp_dir="${HOME}"/.local/share/zsh/site-functions
 rm "${zsh_comp_dir}"/_clever || true
}

uninstall_zsh_root() {
 rm /usr/share/zsh/site-functions/_clever || true
}

uninstall_bash_root() {
 rm /usr/share/bash-completion/completions/clever || true
}

uninstall() {
 if [[ "$USER" = "root" ]]; then
  if which zsh &>/dev/null; then
    uninstall_zsh_root
  fi
  if which bash &>/dev/null; then
    uninstall_bash_root
  fi
 else
  if which zsh &>/dev/null; then
    uninstall_zsh_user
  fi
 fi
}

uninstall

#!/usr/bin/env sh

uninstall_zsh() {
 local zsh_comp_dir="${HOME}"/.local/share/zsh/site-functions
 rm "${zsh_comp_dir}"/_clever || true
}

uninstall() {
 if which zsh &>/dev/null; then
   uninstall_zsh
 fi
}

uninstall

--- 
+++ 
@@ -1,30 +1,13 @@
 #!/usr/bin/env sh
 
-uninstall_zsh_user() {
+uninstall_zsh() {
  local zsh_comp_dir="${HOME}"/.local/share/zsh/site-functions
  rm "${zsh_comp_dir}"/_clever || true
 }
 
-uninstall_zsh_root() {
- rm /usr/share/zsh/site-functions/_clever || true
-}
-
-uninstall_bash_root() {
- rm /usr/share/bash-completion/completions/clever || true
-}
-
 uninstall() {
- if [[ "$USER" = "root" ]]; then
-  if which zsh &>/dev/null; then
-    uninstall_zsh_root
-  fi
-  if which bash &>/dev/null; then
-    uninstall_bash_root
-  fi
- else
-  if which zsh &>/dev/null; then
-    uninstall_zsh_user
-  fi
+ if which zsh &>/dev/null; then
+   uninstall_zsh
  fi
 }
 
Uninstall bash & zsh completion scripts when installed as root
