Update installer

This commit is contained in:
Alexander Gehrke 2023-04-17 14:24:04 +02:00
parent 6ab807af59
commit b42125311e

View file

@ -44,29 +44,7 @@ install_flatpak() {
fi
}
if [[ -z $1 ]]; then
<<-HELP
Usage: $0 [opts] <program_names>
Options:
-p, --path PATH target directory to install into (defaults to ~/.local/bin)
-f, --force overwrite existing files in the same dir
-s, --skip when installing several scripts, skip scripts with unmet
dependencies instead of aborting.
--no-flatpak do not automatically install flatpak deps (still checks for them)
HELP
exit 1
fi
zparseopts -D -E p:=install_path -path:=install_path f=force -force=force \
s=skip -skip=skip -no-flatpak=noflatpakinstall
if [[ ! $install_path ]]; then
install_path=$HOME/.local/bin
else
install_path=${install_path[2]}
fi
for prog in $@; do
install_prog() {
for lang in zsh ruby python amm; do
if uses_interpreter $lang $prog && ! have_dependency $lang; then
if [[ $skip ]]; then
@ -101,4 +79,35 @@ for prog in $@; do
ln -fsr $prog $install_path || fail
succeed
fi
}
if [[ -z $1 ]]; then
<<-HELP
Usage: $0 [opts] <program_names>
Options:
-a, --all install all scripts (except flatpaks)
-p, --path PATH target directory to install into (defaults to ~/.local/bin)
-f, --force overwrite existing files in the same dir
-s, --skip when installing several scripts, skip scripts with unmet
dependencies instead of aborting.
--no-flatpak do not automatically install flatpak deps (still checks for them)
HELP
exit 1
fi
zparseopts -D -E p:=install_path -path:=install_path f=force -force=force \
s=skip -skip=skip -no-flatpak=noflatpakinstall a=all -all=all
if [[ ! $install_path ]]; then
install_path=$HOME/.local/bin
else
install_path=${install_path[2]}
fi
if [[ $all ]]; then
set - devel/* misc/* void/* xdg-wrappers/*
fi
for prog in $@; do
install_prog $prog
done