Created
April 13, 2012 08:59
-
-
Save flopezluis/2375225 to your computer and use it in GitHub Desktop.
require for fabric in ubuntu system
This file contains hidden or 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 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