This commit is contained in:
pika 2025-05-19 18:46:21 +02:00
parent 61957873b9
commit 755901b6c5

View file

@ -127,6 +127,32 @@ silentexec() {
"$@" >/dev/null 2>&1 "$@" >/dev/null 2>&1
} }
source_script() {
local url="$1"
local import="$(mktemp)"
# ─< 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"
sleep 0.1
rm -f "$import"
fi
}
run() { run() {
if $silent; then if $silent; then
silentexec "$@" silentexec "$@"