evolving
This commit is contained in:
parent
61957873b9
commit
755901b6c5
1 changed files with 26 additions and 0 deletions
26
distros.sh
26
distros.sh
|
@ -127,6 +127,32 @@ silentexec() {
|
|||
"$@" >/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() {
|
||||
if $silent; then
|
||||
silentexec "$@"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue