diff --git a/yazi.sh b/yazi.sh index 38a793c..32aee74 100644 --- a/yazi.sh +++ b/yazi.sh @@ -1,11 +1,19 @@ { #!/usr/bin/env bash + PACKAGE=yazi + # ─< Check if the given command exists silently >───────────────────────────────────────── command_exists() { command -v "$@" >/dev/null 2>&1 } + if command_exists $PACKAGE; then + echo_error "$PACKAGE is already installed!" + echo_error "Exiting now!" + return 69 + fi + # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user