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

Function _validate_plugin_dir_name

astrbot/cli/utils/plugin.py:35–49  ·  view source on GitHub ↗
(plugin_name: str, source_path: Path)

Source from the content-addressed store, hash-verified

33
34
35def _validate_plugin_dir_name(plugin_name: str, source_path: Path) -> str:
36 plugin_name = plugin_name.strip()
37 plugin_path = Path(plugin_name)
38 has_separator = "/" in plugin_name or "\\" in plugin_name
39 if (
40 not plugin_name
41 or plugin_name in {".", ".."}
42 or plugin_path.is_absolute()
43 or has_separator
44 or plugin_path.name != plugin_name
45 ):
46 raise click.ClickException(
47 f"Local plugin {source_path} metadata.yaml has invalid name: {plugin_name}"
48 )
49 return plugin_name
50
51
52def get_git_repo(url: str, target_path: Path, proxy: str | None = None) -> None:

Callers 1

install_local_pluginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected