diff --git a/test.sh b/test.sh old mode 100755 new mode 100644 index 64ec2f3..63a0a47 --- a/test.sh +++ b/test.sh @@ -1,227 +1,101 @@ -#!/usr/bin/env bash -deplist=() +{ + #!/usr/bin/env bash -# ─< Check if the given command exists silently >───────────────────────────────────────── -command_exists() { - command -v "$@" >/dev/null 2>&1 -} + # ─< Check if the given command exists silently >───────────────────────────────────────── + command_exists() { + command -v "$@" >/dev/null 2>&1 + } -source-script() { - local url="$1" - local import="$(mktemp)" - if command_exists curl; then - curl -fsSL $url -o $import - elif command_exists wget; then - wget -o $import $url - else - echo "curl/wget is required, but missing.." - exit 69 - fi + # WHY: + # This import will give you the following variables: + # _sudo="sudo -E" <- only if non root user + # distro = + # arch = bool + # fedora = bool + # opensuse = bool.... + # You can then use it for, `if $arch; then` + # Also this gives you the _install command, which installs a package pased on the packagemanager/distro used. + # CAUTION: + # This only wokrs for generic package names, like neovim, or vim, or tmux etc.. + # not every package packagemanager has the same packagenames for their packages.. + getImports() { + local url="$1" + local import="$(mktemp)" + if command_exists curl; then + curl -fsSL $url -o $import + elif command_exists wget; then + wget -o $import $url + else + echo "curl/wget is required, but missing.." + exit 69 + fi - . "$import" - sleep 0.1 - rm -f "$import" -} + . "$import" + sleep 0.1 -spin-get-dependencies() { - line + rm -f "$import" + } - spin grey "Getting dependencies.." + ask-stuff() { + choose multiplexer "Select a multiplexer" tmux zellij ─────────────────────────────────────────────────────────────────── - unset PACKAGE - - if command_exists pen; then - pen green bold "Pen exists" - else - pen red bold "Pen does not exist" - fi - - if command_exists spin; then - pen green bold "spin does exist" - else - pen red bold "spin doesn't exist" - fi - - # ─< argument list variables >──────────────────────────────────────────────────────────── - silent=false - - sleep 0.1 - - # ─< parse arguments and get variable contents >────────────────────────────────────────── - for arg in "$@"; do - case "$arg" in - --silent | -s) - export silent=true - ;; - esac - done - - # main -fi