mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 16:36:25 +00:00
feat: bench start --no-prefix (#1040)
* bench start --no-prefix option * help added for --no-prefix option
This commit is contained in:
parent
d6a12221da
commit
547f2bae82
@ -8,11 +8,12 @@ import click
|
|||||||
|
|
||||||
@click.command('start', help="Start Frappe development processes")
|
@click.command('start', help="Start Frappe development processes")
|
||||||
@click.option('--no-dev', is_flag=True, default=False)
|
@click.option('--no-dev', is_flag=True, default=False)
|
||||||
|
@click.option('--no-prefix', is_flag=True, default=False, help="Hide process name from bench start log")
|
||||||
@click.option('--concurrency', '-c', type=str)
|
@click.option('--concurrency', '-c', type=str)
|
||||||
@click.option('--procfile', '-p', type=str)
|
@click.option('--procfile', '-p', type=str)
|
||||||
def start(no_dev, concurrency, procfile):
|
def start(no_dev, concurrency, procfile, no_prefix):
|
||||||
from bench.utils import start
|
from bench.utils import start
|
||||||
start(no_dev=no_dev, concurrency=concurrency, procfile=procfile)
|
start(no_dev=no_dev, concurrency=concurrency, procfile=procfile, no_prefix=no_prefix)
|
||||||
|
|
||||||
|
|
||||||
@click.command('restart', help="Restart supervisor processes or systemd units")
|
@click.command('restart', help="Restart supervisor processes or systemd units")
|
||||||
|
@ -461,7 +461,7 @@ def get_process_manager():
|
|||||||
return proc_man_path
|
return proc_man_path
|
||||||
|
|
||||||
|
|
||||||
def start(no_dev=False, concurrency=None, procfile=None):
|
def start(no_dev=False, concurrency=None, procfile=None, no_prefix=False):
|
||||||
program = get_process_manager()
|
program = get_process_manager()
|
||||||
if not program:
|
if not program:
|
||||||
raise Exception("No process manager found")
|
raise Exception("No process manager found")
|
||||||
@ -476,6 +476,9 @@ def start(no_dev=False, concurrency=None, procfile=None):
|
|||||||
if procfile:
|
if procfile:
|
||||||
command.extend(['-f', procfile])
|
command.extend(['-f', procfile])
|
||||||
|
|
||||||
|
if no_prefix:
|
||||||
|
command.extend(['--no-prefix'])
|
||||||
|
|
||||||
os.execv(program, command)
|
os.execv(program, command)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user