aboutsummaryrefslogtreecommitdiff
path: root/labbot/__main__.py
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2022-09-07 09:52:37 +0200
committerJan200101 <sentrycraft123@gmail.com>2022-09-07 09:52:37 +0200
commit256aeeee6077da0a28bcc2fb19ab7923e472d26a (patch)
treedec941fb85041945e186d007b5150459b7f13223 /labbot/__main__.py
parentec850ccb99d3ebfb8a69483de868097ed8288f7f (diff)
downloadlab-bot-256aeeee6077da0a28bcc2fb19ab7923e472d26a.tar.gz
lab-bot-256aeeee6077da0a28bcc2fb19ab7923e472d26a.zip
add per repository settings
Diffstat (limited to 'labbot/__main__.py')
-rw-r--r--labbot/__main__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/labbot/__main__.py b/labbot/__main__.py
index fdd2537..39d8842 100644
--- a/labbot/__main__.py
+++ b/labbot/__main__.py
@@ -3,6 +3,7 @@ import logging
from typing import List
from importlib import import_module
import json
+import shutil
import labbot.bot
import labbot.config
@@ -98,5 +99,15 @@ def list_instances():
for ins in labbot.config.list_instances():
print(f"- {ins}")
+@main.command(name="remove", help="Remove an instance")
+@click.argument('name')
+@click.option('--yes', is_flag=True, expose_value=False,
+ prompt='Are you sure you want to remove the instance?')
+def remove_instance(name):
+ try:
+ shutil.rmtree(labbot.config.instance_config_dir(name))
+ except FileNotFoundError:
+ print("Instance not found")
+
if __name__ == "__main__":
main() \ No newline at end of file