Run script on macOS only

This commit is contained in:
Brian Zalewski 2023-08-18 14:36:25 -04:00 committed by GitHub
parent b883ffa0a6
commit 66f00729a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,3 @@
{{- if (ne .host.distro.family "darwin") -}}
#!/usr/bin/env bash #!/usr/bin/env bash
# @file macOS Common Dependencies # @file macOS Common Dependencies
# @brief Ensures common system dependencies are installed via Homebrew on macOS # @brief Ensures common system dependencies are installed via Homebrew on macOS
@ -14,7 +13,9 @@
export VOLTA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/volta" export VOLTA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/volta"
export PATH="$VOLTA_HOME/bin:$PATH" export PATH="$VOLTA_HOME/bin:$PATH"
if command -v brew > /dev/null; then ### Ensure system is macOS
if [ -d /Applications ] && [ -d /System ]; then
if command -v brew > /dev/null; then
logg 'Installing base dependencies for macOS using `brew bundle`' logg 'Installing base dependencies for macOS using `brew bundle`'
logg info 'Dependencies: age asdf jq node glow go go-task/tap/go-task gnupg gum m-cli progress volta yq m-cli yq zx' logg info 'Dependencies: age asdf jq node glow go go-task/tap/go-task gnupg gum m-cli progress volta yq m-cli yq zx'
logg info 'GNU compatibility dependencies: coreutils findutils' logg info 'GNU compatibility dependencies: coreutils findutils'
@ -32,7 +33,7 @@ if command -v brew > /dev/null; then
logg info 'Updating Python 3 version with `brew link --overwrite python@3.11`' logg info 'Updating Python 3 version with `brew link --overwrite python@3.11`'
brew link --overwrite python@3.11 brew link --overwrite python@3.11
fi fi
else else
logg error '`brew` was not found in the PATH' logg error '`brew` was not found in the PATH'
fi
fi fi
{{ end -}}