From d6ba8c65b382a413e5e94969e81c86e72135211f Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 11 May 2025 13:10:29 +0200 Subject: [PATCH] wip --- neovim.sh | 57 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/neovim.sh b/neovim.sh index bde3f73..e8dce0a 100644 --- a/neovim.sh +++ b/neovim.sh @@ -9,7 +9,7 @@ # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user - # distro = + # distro = # arch = bool # fedora = bool # opensuse = bool.... @@ -18,12 +18,21 @@ # 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" + echo_warning "cleaned $import" + } checkAndInstall() { for deps in "$@"; do @@ -80,19 +89,23 @@ fi } - case "$1" in - --silent | -s) - echo_info "updating sources and installing base dependencies.." - silentexec installBuildDependencies - echo_info "cloning sources.." - silentexec cloneSources - echo_info "installing neovim.." - silentexec makeInstall - ;; - *) - installBuildDependencies - cloneSources - makeInstall - ;; - esac + if getImports; then + case "$1" in + --silent | -s) + echo_info "Updating sources and installing base dependencies.." + silentexec installBuildDependencies + + echo_info "Cloning neovim sources.." + silentexec cloneSources + + echo_info "Building neovim.." + silentexec makeInstall + ;; + *) + installBuildDependencies + cloneSources + makeInstall + ;; + esac + fi }