MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / remove_dir

Function remove_dir

astrbot/core/utils/io.py:56–63  ·  view source on GitHub ↗
(file_path: str)

Source from the content-addressed store, hash-verified

54
55
56def remove_dir(file_path: str) -> bool:
57 if not os.path.lexists(file_path):
58 return True
59 if os.path.isfile(file_path) or os.path.islink(file_path):
60 os.remove(file_path)
61 else:
62 shutil.rmtree(file_path, onerror=on_error)
63 return True
64
65
66def ensure_dir(dir_path: str | Path) -> None:

Callers 7

check_dashboard_filesFunction · 0.90
uninstall_pluginMethod · 0.90
updateMethod · 0.90

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected