INNER CODE UNIT · Python
main
googleapis/mcp-toolbox · .ci/update_docs_versions.py:20
def main():
# Read version from command line argument if provided, otherwise from cmd/version.txt
if len(sys.argv) > 1 and sys.argv[1].strip():
version_raw = sys.argv[1].strip()
else:
version_file_path = os.path.join(os.path.dirname(__file__), '../cmd/version.txt')
if not os.path.exists(version_file_path):
print(f"Error: Version file {version_file_path} not found.")
sys.exit(1)
with open(version_file_path, 'r') as f:
version_raw = f.read().strip()
if not version_raw:
print("Error: Version file is empty.")
sys.exit(1)
# Ensure it starts with 'v'