aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/run-tool.js
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-11-30 17:14:21 +0800
committerGitHub <noreply@github.com>2024-11-30 17:14:21 +0800
commitd2a537c3743963bfb6add44731dd3f3f6c785a2e (patch)
treee499f1217135741622995ba253ad34ea9164f358 /scripts/run-tool.js
parentc4ba6ff379bdce768f6053671309e2e2f4a6fc79 (diff)
downloadllm-functions-docker-d2a537c3743963bfb6add44731dd3f3f6c785a2e.tar.gz
refactor: several improvements (#132)
- js export expression - check args regarding run-agent/run-tool
Diffstat (limited to 'scripts/run-tool.js')
-rwxr-xr-xscripts/run-tool.js7
1 files changed, 6 insertions, 1 deletions
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 <tool-name> <tool-data>`);
+ process.exit(1);
+ }
+
return [toolName, toolData];
}