Skip to content

Instantly share code, notes, and snippets.

@brunogama
Created August 18, 2019 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunogama/216f4e34517edbaf9cbbf342400e15d4 to your computer and use it in GitHub Desktop.
Save brunogama/216f4e34517edbaf9cbbf342400e15d4 to your computer and use it in GitHub Desktop.
Filesystem checks
#!/usr/bin/env zsh
case "$OSTYPE" in
darwin*) IS_OSX=1 ;;
solaris*) IS_SOLARIS=1 ;;
linux*) IS_LINUX=1 ;;
bsd*) IS_BSD=1 ;;
*) ;;
esac
if (( $IS_MAC )); then
(( $+commands[brew] )) && HAS_BREW=1
fi
if (( $IS_LINUX )); then
(( $+commands[apt-get] )) && HAS_APT=1
(( $+commands[yum] )) && HAS_YUM=1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment