Update installer
This commit is contained in:
parent
6ab807af59
commit
b42125311e
55
install.zsh
55
install.zsh
|
@ -44,29 +44,7 @@ install_flatpak() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -z $1 ]]; then
|
install_prog() {
|
||||||
<<-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
|
|
||||||
for lang in zsh ruby python amm; do
|
for lang in zsh ruby python amm; do
|
||||||
if uses_interpreter $lang $prog && ! have_dependency $lang; then
|
if uses_interpreter $lang $prog && ! have_dependency $lang; then
|
||||||
if [[ $skip ]]; then
|
if [[ $skip ]]; then
|
||||||
|
@ -101,4 +79,35 @@ for prog in $@; do
|
||||||
ln -fsr $prog $install_path || fail
|
ln -fsr $prog $install_path || fail
|
||||||
succeed
|
succeed
|
||||||
fi
|
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
|
done
|
||||||
|
|
Loading…
Reference in a new issue