bench use <site> should check if the site exists (#5849)
* bench use <site> should check if the site exists * check site path while running use site
This commit is contained in:
parent
191684f6a5
commit
630858eb96
1 changed files with 5 additions and 2 deletions
|
|
@ -277,8 +277,11 @@ def _use(site, sites_path='.'):
|
|||
use(site, sites_path=sites_path)
|
||||
|
||||
def use(site, sites_path='.'):
|
||||
with open(os.path.join(sites_path, "currentsite.txt"), "w") as sitefile:
|
||||
sitefile.write(site)
|
||||
if os.path.exists(os.path.join(sites_path, site)):
|
||||
with open(os.path.join(sites_path, "currentsite.txt"), "w") as sitefile:
|
||||
sitefile.write(site)
|
||||
else:
|
||||
print("{} does not exist".format(site))
|
||||
|
||||
@click.command('backup')
|
||||
@click.option('--with-files', default=False, is_flag=True, help="Take backup with files")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue