Skip to content

Instantly share code, notes, and snippets.

@flopezluis
Created April 13, 2012 08:59
Show Gist options
  • Save flopezluis/2375225 to your computer and use it in GitHub Desktop.
Save flopezluis/2375225 to your computer and use it in GitHub Desktop.
require for fabric in ubuntu system
def require(package):
with settings(hide('stdout'), warn_only=True):
out = run('dpkg -s %s' %package)
if not out.succeeded:
print "The package is not installed. Installing \n"
sudo("apt-get install %s" %package)
else:
print "The package is installed.\n"
#######
Usage:
def deploy():
require('curl')
sudo('curl -O ....")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment