Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support force-removing a site after deleting associated files #258

Open
tomuram opened this issue Sep 16, 2022 · 0 comments
Open

Support force-removing a site after deleting associated files #258

tomuram opened this issue Sep 16, 2022 · 0 comments

Comments

@tomuram
Copy link
Collaborator

tomuram commented Sep 16, 2022

If a Balsam site is created, and the associated files are removed, the Site cannot be deleted.

$ balsam site init -n x x
$ balsam site ls
ID.       Name            Path            Active
341     x                     /path/to/x   No
$ rm -rf x
$ balsam site rm x
Usage: balsam site rm [OPTIONS] PATH
Try 'balsam site rm --help' for help.

Error: Invalid value for 'PATH': Directory 'x' does not exist.

Expected behavior: The site should be deleted. Balsam attempts to validate the Site directory, which is perfectly reasonable, to avoid unintentionally removing a site from the server. Suggested fix is to add an explicit delete option such as balsam site rm --id 341, which would require the user to know the site id.

Workaround: Create a new site, copy it to the original site directory, change the site id to point to the original site, then remove

$ balsam site init -n y y
$ cp -r y x
$ echo 341 > x/.balsam-site
$ balsam rm x
Do you really want to destroy x?  [y/N]: y
Deleted site x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant