2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-09 16:36:25 +00:00

Merge pull request #632 from codingCoffee/vishi

resolved conflicts
This commit is contained in:
Ameya Shenoy 2018-04-11 16:28:20 +05:30 committed by GitHub
commit 67f687432e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)