Skip to content

Instantly share code, notes, and snippets.

@tijptjik
Created March 15, 2014 11:40
Show Gist options
  • Save tijptjik/9565699 to your computer and use it in GitHub Desktop.
Save tijptjik/9565699 to your computer and use it in GitHub Desktop.
Fabric OS check
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