1
0
Fork 0
mirror of https://gitlab.com/mlunax/dotfiles.git synced 2025-04-16 07:26:51 +00:00

Check for required commands before installation

This commit is contained in:
Luna 2023-06-02 11:58:14 +02:00
parent 1ae9d47593
commit 58dd61af65

View file

@ -1,6 +1,13 @@
#!/usr/bin/env zsh
# env, because some OSes keep zsh in /bin (I'm looking at you, Alpine)
for cmd in curl git sed install find; do
if ! command -v $cmd >/dev/null; then
echo "[!] $cmd not found"
exit 1
fi
done
install() {
# screw you coreutils install and your ugly messages
command install -Dv $@ | grep -v removed
@ -59,5 +66,6 @@ find bin -type f | while read -r file; do
install $file $(echo $file | sed "s|bin|$HOME/.local/bin|")
done
unfunction install
source $HOME/.zshrc
exec zsh