Created
August 18, 2019 18:28
-
-
Save brunogama/216f4e34517edbaf9cbbf342400e15d4 to your computer and use it in GitHub Desktop.
Filesystem checks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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