refactor: several improvements (#132)
- js export expression - check args regarding run-agent/run-tool
This commit is contained in:
+6
-1
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user