From 987f201ed1579cbaa6a01ae16b379aea8afd95a0 Mon Sep 17 00:00:00 2001 From: shenjack-5600u <3695888@qq.com> Date: Sun, 5 May 2024 22:25:18 +0800 Subject: [PATCH] aaa --- ica-rs/plugins/md5/md5.js | 5 ++++- ica-rs/plugins/namerena.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ica-rs/plugins/md5/md5.js b/ica-rs/plugins/md5/md5.js index bed9e21..6b95900 100644 --- a/ica-rs/plugins/md5/md5.js +++ b/ica-rs/plugins/md5/md5.js @@ -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; diff --git a/ica-rs/plugins/namerena.py b/ica-rs/plugins/namerena.py index 5a7a8a5..80adca2 100644 --- a/ica-rs/plugins/namerena.py +++ b/ica-rs/plugins/namerena.py @@ -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") # 发送结果