Skip to content

Commit 8eee7d5

Browse files
committed
chore: remove duplicate GOVERNANCE files, keep GOVERNANCE.md
1 parent 5ce5edf commit 8eee7d5

2 files changed

Lines changed: 55 additions & 162 deletions

File tree

GOVERNANCE.adoc

Lines changed: 0 additions & 162 deletions
This file was deleted.

scripts/mise_to_a2ml.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env python3
2+
import os
3+
import sys
4+
5+
def parse_tool_versions(filepath):
6+
tools = {}
7+
if not os.path.exists(filepath):
8+
return tools
9+
with open(filepath, 'r') as f:
10+
for line in f:
11+
line = line.strip()
12+
if not line or line.startswith('#'):
13+
continue
14+
parts = line.split()
15+
if len(parts) >= 2:
16+
tools[parts[0]] = parts[1]
17+
return tools
18+
19+
def generate_a2ml_scm(tools):
20+
lines = []
21+
lines.append("(scm-dialect")
22+
lines.append(" (metadata")
23+
lines.append(" (schema-version \"1.0\")")
24+
lines.append(" (generator \"opsm-mise-translator\"))")
25+
lines.append(" (dependencies")
26+
27+
for tool, version in tools.items():
28+
lines.append(f" (package (name \"{tool}\") (version \"{version}\") (provider \"mise\"))")
29+
30+
lines.append(" )")
31+
lines.append(")")
32+
return "\n".join(lines)
33+
34+
def main():
35+
if len(sys.argv) < 3:
36+
print("Usage: mise_to_a2ml.py <path_to_tool_versions> <output_a2ml_path>")
37+
sys.exit(1)
38+
39+
input_file = sys.argv[1]
40+
output_file = sys.argv[2]
41+
42+
tools = parse_tool_versions(input_file)
43+
if not tools:
44+
print(f"No tools found or file missing: {input_file}")
45+
sys.exit(0)
46+
47+
a2ml_content = generate_a2ml_scm(tools)
48+
49+
with open(output_file, 'w') as f:
50+
f.write(a2ml_content)
51+
52+
print(f"Successfully translated {len(tools)} tools into A2ML SCM dialect at {output_file}")
53+
54+
if __name__ == "__main__":
55+
main()

0 commit comments

Comments
 (0)