-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Remove installed collections""" | ||
|
||
import shutil | ||
from icm.commons import commons | ||
|
||
|
||
def main(name: str) -> None: | ||
"""ENTRY POINT: Remove collections | ||
* name: Name of the collection to remove | ||
""" | ||
|
||
# -- Get context information | ||
# ctx = commons.Context() | ||
folders = commons.Folders() | ||
print() | ||
|
||
# -- Build the Path to the collection | ||
abs_collection = folders.collections / name | ||
|
||
# -- Check if the collection exists, as it was type byte the user | ||
if not abs_collection.exists(): | ||
print(f"rm: cannot remove {name}: No such collection") | ||
return | ||
|
||
# -- Remove the collection folder, along with all its files | ||
shutil.rmtree(abs_collection) |