diff --git a/plugins/md5/md5-api.js b/plugins/md5/md5-api.js index e9ca44d..ca7af93 100644 --- a/plugins/md5/md5-api.js +++ b/plugins/md5/md5-api.js @@ -231,7 +231,7 @@ function main() { fs = require("fs"); path = require("path"); process = require("process"); - if (!(process.argv.length > 2 && process.argv[2] === "fight")) return [3 /*break*/, 2]; + if (!("fight" in process.argv)) return [3 /*break*/, 2]; names_1 = fs.readFileSync(path.resolve(__dirname, "input.txt"), "utf-8"); return [4 /*yield*/, fight_only(names_1)]; case 1: diff --git a/plugins/md5/md5-api.ts b/plugins/md5/md5-api.ts index a62ae56..b276ba4 100644 --- a/plugins/md5/md5-api.ts +++ b/plugins/md5/md5-api.ts @@ -201,7 +201,7 @@ async function main() { const process = require("process"); // 读取 cli // 有 fight 参数就开启 fight_only模式 - if (process.argv.length > 2 && process.argv[2] === "fight") { + if ("fight" in process.argv) { const names = fs.readFileSync(path.resolve(__dirname, "input.txt"), "utf-8"); await fight_only(names); return;