diff --git a/template.sh b/template.sh index 20ec8d8..5ddc088 100644 --- a/template.sh +++ b/template.sh @@ -18,24 +18,41 @@ # 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.. - if command_exists curl; then - eval "$(curl -fsSL https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh)" - else - echo "curl is required, but missing.." - exit 1 - fi + getImports() { + i="https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh" + import="$(mktemp)" + if command_exists curl; then + curl -fsSL $i -o $import + else + echo "curl is required, but missing.." + exit 1 + fi + + source "$import" + sleep 0.3 + rm "$import" + } main() { case "$distro" in arch) echo "arch" ;; - debian | ubuntu) + debian) echo "debian" ;; + ubuntu) + echo "ubuntu" + ;; fedora) echo "fedora" ;; + alpine) + echo "alpine" + ;; + opensuse) + echo "opensuse" + ;; *) echo "$distro is not supported by this script!" exit 1 @@ -43,5 +60,7 @@ esac } - main + if getImports; then + main + fi }