From cd9fd58475730b8b9c2bc02b5d19ddf31df7e7f5 Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 11 May 2025 12:12:18 +0200 Subject: [PATCH] tryed better way for getting import script --- yazi.sh | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/yazi.sh b/yazi.sh index d3cb030..33d693e 100644 --- a/yazi.sh +++ b/yazi.sh @@ -18,12 +18,24 @@ # 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 https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh -o $import + else + echo "curl is required, but missing.." + exit 1 + fi + + source "$import" + } + # 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 checkDependencies() { local deps=( @@ -85,5 +97,7 @@ fi } - main + if getImports; then + main + fi }