MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / main

Function main

scripts/docs/freeze_current_edge.py:42–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40
41
42def main() -> int:
43 parser = argparse.ArgumentParser(description=__doc__)
44 parser.add_argument(
45 "version",
46 help='New release version as "X.Y.Z" (no leading v). Example: 1.15.0',
47 )
48 args = parser.parse_args()
49
50 docs_root = _repo_root() / "docs"
51 try:
52 result = freeze(args.version, docs_root)
53 except InvalidVersionError as e:
54 print(f"ERROR: {e}", file=sys.stderr)
55 return 1
56 except MissingEdgeSourcesError as e:
57 print(f"ERROR: {e}", file=sys.stderr)
58 return 1
59
60 relative_snapshot = result.snapshot_path.relative_to(docs_root.parent)
61 if result.snapshot_already_existed:
62 print(f"Snapshot directory already exists: {relative_snapshot}")
63 print("Skipping copy. Re-running docs.json migration only.")
64 else:
65 print(
66 f"Froze Edge -> {relative_snapshot} "
67 f"({result.files_copied} files, "
68 f"{result.openapi_refs_rewritten} openapi refs rewritten)."
69 )
70
71 print(
72 f"Updated docs/docs.json: inserted {result.version_slug} into "
73 f"{result.docsjson_entries_inserted} language block(s), "
74 f"skipped {result.docsjson_entries_skipped}, "
75 f"upserted {result.redirects_upserted} canonical-URL redirects."
76 )
77 print()
78 print("Commit message suggestion:")
79 print(f" [docs-freeze] snapshot docs for {result.version_slug}")
80 return 0
81
82
83if __name__ == "__main__":

Callers 1

Calls 2

freezeFunction · 0.90
_repo_rootFunction · 0.70

Tested by

no test coverage detected