This commit is contained in:
shenjack-5600u 2024-05-05 22:25:18 +08:00
parent 2f1cffc1e6
commit 987f201ed1
Signed by: shenjack
GPG Key ID: FDF9864E11C7E79F
2 changed files with 7 additions and 2 deletions

View File

@ -135,7 +135,10 @@ if (run_env.from_code) {
global.finish_trigger = finish_trigger;
// 读取 input.txt
const input_path = path.join(__dirname, "input.txt");
// const input_path = path.join(__dirname, "input.txt");
// 从 cli 参数里读取
const input_path = run_env.cli_args[2];
logger.debug("input_path", input_path);
const input_data = fs.readFileSync(input_path, "utf-8");
global.name_input = input_data;

View File

@ -34,7 +34,9 @@ def on_ica_message(msg: IcaNewMessage, client: IcaClient) -> None:
with open(root_path / "md5" / "input.txt", "w") as f:
f.write(names)
# 执行 node md5.js
result = subprocess.run(["node", (root_path / "md5" / "md5.js").absolute()], stdout=subprocess.PIPE)
runner_path = root_path / "md5" / "md5.js"
input_path = root_path / "md5" / "input.txt"
result = subprocess.run(["node", runner_path.absolute(), input_path.absolute()], stdout=subprocess.PIPE)
# 获取结果
result = result.stdout.decode("utf-8")
# 发送结果