Skip to content

Commit

Permalink
feat: Option to provide path to Procfile
Browse files Browse the repository at this point in the history
  • Loading branch information
netchampfaris committed Aug 24, 2019
1 parent 503bad0 commit 5bedd2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions bench/commands/utils.py
Expand Up @@ -5,10 +5,11 @@
@click.command('start')
@click.option('--no-dev', is_flag=True, default=False)
@click.option('--concurrency', '-c', type=str)
def start(no_dev, concurrency):
@click.option('--procfile', '-p', type=str)
def start(no_dev, concurrency, procfile):
"Start Frappe development processes"
from bench.utils import start
start(no_dev=no_dev, concurrency=concurrency)
start(no_dev=no_dev, concurrency=concurrency, procfile=procfile)


@click.command('restart')
Expand Down
5 changes: 4 additions & 1 deletion bench/utils.py
Expand Up @@ -317,7 +317,7 @@ def get_program(programs):
def get_process_manager():
return get_program(['foreman', 'forego', 'honcho'])

def start(no_dev=False, concurrency=None):
def start(no_dev=False, concurrency=None, procfile=None):
program = get_process_manager()
if not program:
raise Exception("No process manager found")
Expand All @@ -329,6 +329,9 @@ def start(no_dev=False, concurrency=None):
if concurrency:
command.extend(['-c', concurrency])

if procfile:
command.extend(['-f', procfile])

os.execv(program, command)

def check_cmd(cmd, cwd='.'):
Expand Down

0 comments on commit 5bedd2c

Please sign in to comment.