 update: submodules

This commit is contained in:
pika 2025-05-24 14:18:18 +02:00
parent 647601a743
commit 4467dcd82e

View file

@ -8,19 +8,29 @@ command_exists() {
source-script() { source-script() {
local url="$1" local url="$1"
local import="$(mktemp)" 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" # ─< if $1 is a local file, source this one instead >─────────────────────────────────────
sleep 0.2 if [ -f "$url" ]; then
rm "$import" source "$url"
echo "imported $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__() { __pre_stow__() {