mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-15 21:53:41 +00:00
Fix: Changes to have command usage
This commit is contained in:
@@ -164,7 +164,9 @@ function section_brew
|
|||||||
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
|
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
} || menu_section "$USAGE_PREFIX" "brew not available on this system"
|
}
|
||||||
|
|
||||||
|
! have brew && menu_section "$USAGE_PREFIX" "brew not available on this system"
|
||||||
}
|
}
|
||||||
|
|
||||||
function section_dotfiles
|
function section_dotfiles
|
||||||
@@ -207,7 +209,8 @@ function section_dotfiles
|
|||||||
;;
|
;;
|
||||||
yamlfmt)
|
yamlfmt)
|
||||||
# format yaml files
|
# format yaml files
|
||||||
have yamlfmt && yamlfmt -conf "$DOTFILES/.yamlfmt" || msg_err "yamlfmt not found"
|
have yamlfmt && yamlfmt -conf "$DOTFILES/.yamlfmt"
|
||||||
|
! have yamlfmt && msg_err "yamlfmt not found"
|
||||||
;;
|
;;
|
||||||
shfmt)
|
shfmt)
|
||||||
# Format shell scripts according to following rules.
|
# Format shell scripts according to following rules.
|
||||||
|
|||||||
@@ -39,4 +39,7 @@ have gh && {
|
|||||||
done
|
done
|
||||||
|
|
||||||
msg_ok "Done"
|
msg_ok "Done"
|
||||||
} || msg_err "gh (GitHub Client) could not be found, please install it first"
|
}
|
||||||
|
|
||||||
|
! have gh \
|
||||||
|
&& msg_err "gh (GitHub Client) could not be found, please install it first"
|
||||||
|
|||||||
@@ -34,4 +34,6 @@ have go && {
|
|||||||
done
|
done
|
||||||
|
|
||||||
msg_ok "Done"
|
msg_ok "Done"
|
||||||
} || msg "go hasn't been installed yet."
|
}
|
||||||
|
|
||||||
|
! have go && msg "go hasn't been installed yet."
|
||||||
|
|||||||
@@ -36,4 +36,6 @@ have npm && {
|
|||||||
msg_run "Upgrading all global packages"
|
msg_run "Upgrading all global packages"
|
||||||
npm -g --no-progress --no-timing --no-fund outdated
|
npm -g --no-progress --no-timing --no-fund outdated
|
||||||
npm -g --no-timing --no-fund upgrade
|
npm -g --no-timing --no-fund upgrade
|
||||||
} || msg_err "npm could not be found."
|
}
|
||||||
|
|
||||||
|
! have npm && msg_err "npm could not be found."
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
have ntfy && {
|
have ntfy && msg "ntfy already installed"
|
||||||
msg "ntfy already installed"
|
|
||||||
} || {
|
! have ntfy && {
|
||||||
case $(dfm check arch) in
|
case $(dfm check arch) in
|
||||||
Linux)
|
Linux)
|
||||||
NTFY_ARCH="linux_$(arch)"
|
NTFY_ARCH="linux_$(arch)"
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
# Ismo Vuorinen <https://github.com/ivuorinen> 2018
|
# Ismo Vuorinen <https://github.com/ivuorinen> 2018
|
||||||
#
|
#
|
||||||
|
|
||||||
|
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0
|
||||||
|
|
||||||
|
! have xcode-select \
|
||||||
|
&& msg_err "xcode-select could not be found, skipping" \
|
||||||
|
&& exit 0
|
||||||
|
|
||||||
# Ask for the administrator password upfront
|
# Ask for the administrator password upfront
|
||||||
sudo -v
|
sudo -v
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user