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:
parent
1ae9d47593
commit
58dd61af65
1 changed files with 9 additions and 1 deletions
10
install.zsh
10
install.zsh
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue