diff --git a/local/bin/dfm b/local/bin/dfm index 3c03385..22b0c20 100755 --- a/local/bin/dfm +++ b/local/bin/dfm @@ -164,7 +164,9 @@ function section_brew menu_usage "$USAGE_PREFIX" "${MENU[@]}" ;; 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 @@ -207,7 +209,8 @@ function section_dotfiles ;; yamlfmt) # 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) # Format shell scripts according to following rules. diff --git a/scripts/install-gh-extensions.sh b/scripts/install-gh-extensions.sh index d42aebc..ffba0bf 100755 --- a/scripts/install-gh-extensions.sh +++ b/scripts/install-gh-extensions.sh @@ -39,4 +39,7 @@ have gh && { 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" diff --git a/scripts/install-go-packages.sh b/scripts/install-go-packages.sh index 302afd9..53f924b 100755 --- a/scripts/install-go-packages.sh +++ b/scripts/install-go-packages.sh @@ -34,4 +34,6 @@ have go && { done msg_ok "Done" -} || msg "go hasn't been installed yet." +} + +! have go && msg "go hasn't been installed yet." diff --git a/scripts/install-npm-packages.sh b/scripts/install-npm-packages.sh index 48371af..db4db89 100755 --- a/scripts/install-npm-packages.sh +++ b/scripts/install-npm-packages.sh @@ -36,4 +36,6 @@ have npm && { msg_run "Upgrading all global packages" npm -g --no-progress --no-timing --no-fund outdated npm -g --no-timing --no-fund upgrade -} || msg_err "npm could not be found." +} + +! have npm && msg_err "npm could not be found." diff --git a/scripts/install-ntfy.sh b/scripts/install-ntfy.sh index b2f491a..be10d93 100755 --- a/scripts/install-ntfy.sh +++ b/scripts/install-ntfy.sh @@ -6,9 +6,9 @@ source "$HOME/.dotfiles/scripts/shared.sh" set -e -have ntfy && { - msg "ntfy already installed" -} || { +have ntfy && msg "ntfy already installed" + +! have ntfy && { case $(dfm check arch) in Linux) NTFY_ARCH="linux_$(arch)" diff --git a/scripts/install-xcode-cli-tools.sh b/scripts/install-xcode-cli-tools.sh index 24044c0..7d109dd 100755 --- a/scripts/install-xcode-cli-tools.sh +++ b/scripts/install-xcode-cli-tools.sh @@ -4,6 +4,12 @@ # Ismo Vuorinen 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 sudo -v