From 4467dcd82e7a8627dca1fc2c3a235301906e7edc Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 24 May 2025 14:18:18 +0200 Subject: [PATCH] =?UTF-8?q?=EF=80=99=20update:=20submodules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/install.sh b/install.sh index 5a5a73d..646675e 100755 --- a/install.sh +++ b/install.sh @@ -8,19 +8,29 @@ command_exists() { 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 - source "$import" - sleep 0.2 - rm "$import" - echo "imported $url" + # ─< if $1 is a local file, source this one instead >───────────────────────────────────── + if [ -f "$url" ]; then + source "$url" + sleep 0.1 + return 0 + else + # ─< if $1 is a url, grab it and source it, also deletes afterwards >───────────────────── + 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 + + source "$import" + + echo "${BLUE}Sourcing external script:${NC} $url" + sleep 0.1 + rm -f "$import" + fi } __pre_stow__() {