From d2a537c3743963bfb6add44731dd3f3f6c785a2e Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 30 Nov 2024 17:14:21 +0800 Subject: refactor: several improvements (#132) - js export expression - check args regarding run-agent/run-tool --- scripts/run-tool.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/run-tool.js') diff --git a/scripts/run-tool.js b/scripts/run-tool.js index 4a806f3..3a1c86e 100755 --- a/scripts/run-tool.js +++ b/scripts/run-tool.js @@ -28,10 +28,15 @@ function parseArgv(thisFileName) { toolData = process.argv[2]; } - if (toolName.endsWith(".js")) { + if (toolName && toolName.endsWith(".js")) { toolName = toolName.slice(0, -3); } + if (!toolData || !toolName) { + console.log(`Usage: ./run-tools.js `); + process.exit(1); + } + return [toolName, toolData]; } -- cgit v1.2.3