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

[minor] setup: fix overwrite existing site

fixed a casing issue where entering "N" would overwrite the site.

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>
This commit is contained in:
Chinmay Pai 2018-08-29 12:47:20 +05:30
parent f969555835
commit 0c7b92b0f1
No known key found for this signature in database
GPG Key ID: 75507BE256F40CED

View File

@ -180,14 +180,17 @@ def setup_manager(yes=False, port=23624, domain=None):
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")
ans = input('Site already exists. Overwrite existing site? [Y/n]: ').lower()
while ans not in ('y', 'n', ''):
ans = input(
'Please enter "y" or "n". Site already exists. Overwrite existing site? [Y/n]: ').lower()
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')
print('App already exists. Skipping app download.')
else:
exec_cmd("bench get-app bench_manager")