Created
July 5, 2012 13:06
-
-
Save valdergallo/3053565 to your computer and use it in GitHub Desktop.
Create config with fabric example
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
from fabric.contrib.files import append, contains, exists | |
@task | |
def config_insert_line(): | |
insert_this = """something""" | |
if exists('somefile.conf'): | |
if not contains('somefile.conf', insert_this): | |
append('somefile.conf', insert_this) | |
else: | |
append('somefile.conf', insert_this) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment