Skip to content

Instantly share code, notes, and snippets.

@valdergallo
Created July 5, 2012 13:06
Show Gist options
  • Save valdergallo/3053565 to your computer and use it in GitHub Desktop.
Save valdergallo/3053565 to your computer and use it in GitHub Desktop.
Create config with fabric example
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