diff --git a/hyprlock.sh b/hyprlock.sh index 7ab9e3c..1ce5b07 100644 --- a/hyprlock.sh +++ b/hyprlock.sh @@ -1,22 +1,10 @@ #!/usr/bin/env bash -unset PACKAGE && - PACKAGE=hyprlock && - echo_note "Installing $PACKAGE.." - -sleep 1 - # ─< Check if the given command exists silently >───────────────────────────────────────── command_exists() { command -v "$@" >/dev/null 2>&1 } -if command_exists $PACKAGE; then - echo_warning "$PACKAGE is alread installed!" - echo_warning "Exiting now!" - exit 69 -fi - # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -44,6 +32,18 @@ getImports() { source "$import" sleep 0.2 rm "$import" + + if command_exists $PACKAGE; then + echo_warning "$PACKAGE is alread installed!" + echo_warning "Exiting now!" + exit 69 + fi + + unset PACKAGE && + PACKAGE=hyprlock && + echo_note "Installing $PACKAGE.." + + sleep 1 } checkComp() {