diff options
| author | sigoden <sigoden@gmail.com> | 2024-11-30 17:14:21 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-30 17:14:21 +0800 |
| commit | d2a537c3743963bfb6add44731dd3f3f6c785a2e (patch) | |
| tree | e499f1217135741622995ba253ad34ea9164f358 /scripts/run-tool.js | |
| parent | c4ba6ff379bdce768f6053671309e2e2f4a6fc79 (diff) | |
| download | llm-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-x | scripts/run-tool.js | 7 |
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]; } |
