2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

Merge pull request #714 from Thunderbottom/case-fix

[minor] setup: fix overwrite existing site
This commit is contained in:
Ameya Shenoy 2018-09-06 16:40:44 +05:30 committed by GitHub
commit 2e7619c128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,15 +179,18 @@ def setup_manager(yes=False, port=23624, domain=None):
"Setup bench-manager.local site with the bench_manager app installed on it" "Setup bench-manager.local site with the bench_manager app installed on it"
from six.moves import input from six.moves import input
create_new_site = True create_new_site = True
if 'bench-manager.local' in os.listdir('sites'): if 'bench-manager.local' in os.listdir('sites'):
ans = input('Site aleady exists. Overwrite existing new site? [Y/n]: ') ans = input('Site already exists. Overwrite existing site? [Y/n]: ').lower()
while ans.lower() not in ['y', 'n', '']: while ans not in ('y', 'n', ''):
ans = input('Please type "y" or "n". Site aleady exists. Overwrite existing new site? [Y/n]: ') ans = input(
if ans=='n': create_new_site = False 'Please enter "y" or "n". Site already exists. Overwrite existing site? [Y/n]: ').lower()
if create_new_site: exec_cmd("bench new-site --force bench-manager.local") 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'): if 'bench_manager' in os.listdir('apps'):
print('App aleady exists. Skipping downloading the app') print('App already exists. Skipping app download.')
else: else:
exec_cmd("bench get-app bench_manager") exec_cmd("bench get-app bench_manager")
@ -201,7 +204,7 @@ def setup_manager(yes=False, port=23624, domain=None):
if not domain: if not domain:
print("Please specify the site name on which you want to host bench-manager using the 'domain' flag") print("Please specify the site name on which you want to host bench-manager using the 'domain' flag")
sys.exit(1) sys.exit(1)
from bench.utils import get_sites, get_bench_name from bench.utils import get_sites, get_bench_name
bench_name = get_bench_name(bench_path) bench_name = get_bench_name(bench_path)