File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,17 +73,23 @@ This is a first pass, will likely change.
7373
7474Add 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
7979env.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```
You can’t perform that action at this time.
0 commit comments