|
|
|
|
@ -3,7 +3,7 @@ import sys
|
|
|
|
|
import subprocess
|
|
|
|
|
import traceback
|
|
|
|
|
|
|
|
|
|
TARGET_LANGUAGE = set(["python", "cpp", "go", "rust"])
|
|
|
|
|
TARGET_LANGUAGE = set(["python", "cpp", "go", "rust", "node", "javascript"])
|
|
|
|
|
PROJECT_PATH = "/home/rocker/project"
|
|
|
|
|
|
|
|
|
|
def go_handler():
|
|
|
|
|
@ -27,7 +27,9 @@ def cpp_handler():
|
|
|
|
|
return "", main_path
|
|
|
|
|
|
|
|
|
|
def node_handler():
|
|
|
|
|
pass
|
|
|
|
|
main_path = f"{PROJECT_PATH}/node_project/main.js"
|
|
|
|
|
subprocess.run(["cp", "/tmp/code", main_path], capture_output=True)
|
|
|
|
|
return "", main_path
|
|
|
|
|
|
|
|
|
|
def rust_handler():
|
|
|
|
|
source_path = f"{PROJECT_PATH}/rust_project/src/main.rs"
|
|
|
|
|
@ -65,12 +67,14 @@ def main():
|
|
|
|
|
err, main_path = go_handler()
|
|
|
|
|
cmd.extend([main_path])
|
|
|
|
|
elif language == "node":
|
|
|
|
|
pass
|
|
|
|
|
err, main_path = node_handler()
|
|
|
|
|
cmd.extend(["node", main_path])
|
|
|
|
|
elif language == "rust":
|
|
|
|
|
err, main_path = rust_handler()
|
|
|
|
|
cmd.extend([main_path])
|
|
|
|
|
elif language == "javascript":
|
|
|
|
|
node_handler()
|
|
|
|
|
err, main_path = node_handler()
|
|
|
|
|
cmd.extend(["node", main_path])
|
|
|
|
|
else:
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|