From ae0b6646a0b59d5e55e748286b1bc2c16910470f Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 11 May 2025 13:17:22 +0200 Subject: [PATCH] wip --- distros.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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