Skip to content

Commit 041f73a

Browse files
committed
fix(readme): implementation of fab config command
1 parent 71f096c commit 041f73a

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,23 @@ This is a first pass, will likely change.
7373

7474
Add a config task to your local fabfile, `dotenv_path` is the location of the absolute path of '.env' on the remote server.
7575
```
76-
from fabric.api import task, local, env
76+
from fabric.api import task, run, env
7777
7878
# absolute path to the location of .env on remote server
7979
env.dotenv_path = '/home/me/webapps/myapp/myapp/.env'
8080
8181
@task
82-
def config(action=None,key=None,value=None):
82+
def config(action=None, key=None, value=None):
83+
'''Manage project configuration via .env
84+
85+
see: https://github.com/theskumar/python-dotenv
86+
e.g: fab config:set,[key],[value]
87+
'''
88+
run('touch %(dotenv_path)s' % env)
8389
command = 'dotenv'
84-
command += ' -f %s' % env.dotenv_path)
85-
command += action if action else " "
86-
command += key if key else " "
90+
command += ' -f %s ' % env.dotenv_path
91+
command += action + " " if action else " "
92+
command += key + " " if key else " "
8793
command += value if value else ""
8894
run(command)
8995
```

0 commit comments

Comments
 (0)