Skip to content

Commit 4abfd66

Browse files
Create compiler.py
1 parent 4a655cf commit 4abfd66

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mini_agent/compiler.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from task_runner import run_command
2+
3+
def build(source_dir, lang, output):
4+
if lang == "c":
5+
return run_command(f"gcc {source_dir}/*.c -o {output}")
6+
elif lang == "rust":
7+
return run_command(f"cargo build --manifest-path {source_dir}/Cargo.toml --release")
8+
elif lang == "python":
9+
return run_command(f"pyinstaller --onefile {source_dir}/*.py -n {output}")
10+
else:
11+
return {"status": "error", "output": f"Unsupported lang {lang}"}

0 commit comments

Comments
 (0)