def remove(organization_name):
"""
Remove organizations.
"""
if not organization_name.isalnum():
fatal("Your organization name should only contains alphanumeric "
"characters.")
dest_path = get_env_path(organization_name)
if not os.path.exists(dest_path):
fatal("The %s organization doesn't exist." % organization_name)
if not click.confirm("Do you want to delete the %s organization?" %
organization_name,
default=False):
info("Aborted. Nothing has been done.")
return
if os.path.isdir(dest_path) and not os.path.islink(dest_path):
shutil.rmtree(dest_path)
else:
os.remove(dest_path)
success("The %s organization has been removed." % organization_name)
评论列表
文章目录