Created
March 15, 2014 11:40
-
-
Save tijptjik/9565699 to your computer and use it in GitHub Desktop.
Fabric OS check
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
def osname(): | |
ostype = run('echo $OSTYPE') | |
if ostype == 'darwin': | |
return 'OSX' | |
elif ostype == 'linux-gnu': | |
return run('cat /etc/os-release | grep -Po \'^NAME="?\K([^"]+)\'') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment