mirror of
https://gitlab.com/mlunax/dotfiles.git
synced 2025-04-19 08:45:36 +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
|
#!/usr/bin/env zsh
|
||||||
# env, because some OSes keep zsh in /bin (I'm looking at you, Alpine)
|
# 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() {
|
install() {
|
||||||
# screw you coreutils install and your ugly messages
|
# screw you coreutils install and your ugly messages
|
||||||
command install -Dv $@ | grep -v removed
|
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|")
|
install $file $(echo $file | sed "s|bin|$HOME/.local/bin|")
|
||||||
done
|
done
|
||||||
|
|
||||||
|
unfunction install
|
||||||
|
|
||||||
source $HOME/.zshrc
|
exec zsh
|
||||||
|
|
Loading…
Add table
Reference in a new issue