This commit is contained in:
pika 2025-05-22 12:01:12 +02:00
parent d3d137a22b
commit db7ac16675
3 changed files with 83 additions and 24 deletions

View file

@ -1,3 +1,11 @@
# Define color variables
RED='\033[0;31m'
YELLOW='\033[0;33m'
CYAN='\033[0;36m'
GREEN='\033[1;32m'
NC='\033[0m' # No Color
BOLD='\033[1m'
# INFO:
# ╭──────────╮
# │ defaults │
@ -587,6 +595,37 @@ missing() {
done
}
# INFO:
# ╭─────────────────╮
# │ other functions │
# ╰─────────────────╯
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
echo_info "Sourcing external script:${NC} $url"
# ─< 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
}
main() {
# ─< g stands for GIT >─────────────────────────────────────────────────────────────────────
if command_exists git; then

View file

@ -41,21 +41,23 @@ _check() {
}
_install() {
case "$1" in
--help | -h)
_help
;;
nvim)
if _check; then
_install_func "neovim"
fi
;;
*)
if _check; then
_install_func "$@"
fi
;;
esac
for arg in "$@"; do
case "arg" in
--help | -h)
_help
;;
nvim)
if _check; then
_install_func "neovim"
fi
;;
*)
if _check; then
_install_func "$@"
fi
;;
esac
done
}
# _setup(){