diff --git a/distros.sh b/distros.sh index d8ec417..bdf2035 100755 --- a/distros.sh +++ b/distros.sh @@ -1,3 +1,7 @@ +# INFO: +# ╭──────────────────────────────╮ +# │ User variables and functions │ +# ╰──────────────────────────────╯ distro="" ubuntu="false" debian="false" @@ -38,6 +42,17 @@ silentexec() { "$@" >/dev/null 2>&1 } +checkAndInstall() { + for deps in "$@"; do + if ! command_exists $deps; then + echo_note "$deps is not installed. Installing it now.." + _install "$deps" + else + echo_note "skipping $deps - as it's already installed.." + fi + done +} + # ─< Check if the user is root and set sudo variable if necessary >─────────────────────── check_root() { if [ "$(id -u)" -ne 0 ]; then