Skip to content

Instantly share code, notes, and snippets.

@auxiliumknowledge
Last active March 27, 2024 15:29
Show Gist options
  • Save auxiliumknowledge/c868f6f3aa975d55ee17aa25d54d809f to your computer and use it in GitHub Desktop.
Save auxiliumknowledge/c868f6f3aa975d55ee17aa25d54d809f to your computer and use it in GitHub Desktop.
# Give your checking syntax a meaningful name
# You may enjoy onMacos more, don't judge me
onmacOS() {
[[ ${OSTYPE} == darwin* ]]
}
# Assumes you have configured those variables as sets, so have no duplicate on reload
# Now you can use it as an conditional that is readable
onmacOS && export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
onmacOS && export MANPATH="/opt/homebrew/opt/coreutils/libexec/gnuman:$MANPATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment