MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / remove_docs

Function remove_docs

tasks/scripts/sync_docs_website.py:324–344  ·  view source on GitHub ↗
(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

322
323
324def remove_docs(args: argparse.Namespace) -> None:
325 docs_root = args.docs_website_root.resolve()
326 target_fern = docs_root / "fern"
327
328 ensure_existing(target_fern, "docs website fern directory")
329
330 channel = clean_input(args.channel)
331 version_slug = clean_input(args.version_slug)
332 slug = resolve_slug(channel, version_slug)
333
334 pages_dir = target_fern / f"pages-{slug}"
335 if pages_dir.exists():
336 shutil.rmtree(pages_dir)
337
338 version_file = target_fern / "versions" / f"{slug}.yml"
339 if version_file.exists():
340 version_file.unlink()
341
342 remove_docs_yml_entry(target_fern / "docs.yml", slug, target_fern)
343
344 print(f"Removed {slug} docs from docs website branch")
345
346
347def main() -> None:

Callers 1

mainFunction · 0.85

Calls 6

ensure_existingFunction · 0.85
clean_inputFunction · 0.85
resolve_slugFunction · 0.85
remove_docs_yml_entryFunction · 0.85
existsMethod · 0.80
resolveMethod · 0.45

Tested by

no test coverage detected