From f45862a3ca7238dbb39661bbf673b07068f2ab91 Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Mon, 11 Sep 2017 16:52:00 +0530 Subject: [PATCH] resolved conflicts --- bench/commands/setup.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bench/commands/setup.py b/bench/commands/setup.py index c7a8d12d..f2ce6d12 100755 --- a/bench/commands/setup.py +++ b/bench/commands/setup.py @@ -1,5 +1,6 @@ from bench.utils import exec_cmd import click, sys, json +import os @click.group() def setup(): @@ -153,6 +154,27 @@ def setup_node_requirements(): from bench.utils import update_node_packages update_node_packages() + +@click.command('manager') +def setup_manager(): + "Setup bench-manager.local site with the bench_manager app installed on it" + from six.moves import input + create_new_site = True + if 'bench-manager.local' in os.listdir('sites'): + ans = input('Site aleady exists. Overwrite existing new site? [Y/n]: ') + while ans.lower() not in ['y', 'n', '']: + ans = input('Please type "y" or "n". Site aleady exists. Overwrite existing new site? [Y/n]: ') + if ans=='n': create_new_site = False + if create_new_site: exec_cmd("bench new-site --force bench-manager.local") + + if 'bench_manager' in os.listdir('apps'): + print('App aleady exists. Skipping downloading the app') + else: + exec_cmd("bench get-app bench_manager") + + exec_cmd("bench --site bench-manager.local install-app bench_manager") + + @click.command('config') def setup_config(): "overwrite or make config.json" @@ -246,6 +268,7 @@ setup.add_command(setup_env) setup.add_command(setup_procfile) setup.add_command(setup_socketio) setup.add_command(setup_requirements) +setup.add_command(setup_manager) setup.add_command(setup_config) setup.add_command(setup_fonts) setup.add_command(add_domain)