aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/run-agent.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/run-agent.js')
-rwxr-xr-xscripts/run-agent.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/run-agent.js b/scripts/run-agent.js
index c59ff6e..361d904 100755
--- a/scripts/run-agent.js
+++ b/scripts/run-agent.js
@@ -31,10 +31,15 @@ function parseArgv(thisFileName) {
agentData = process.argv[3];
}
- if (agentName.endsWith(".js")) {
+ if (agentName && agentName.endsWith(".js")) {
agentName = agentName.slice(0, -3);
}
+ if (!agentData || !agentFunc || !agentName) {
+ console.log(`Usage: ./run-agent.js <agent-name> <agent-func> <agent-data>`);
+ process.exit(1);
+ }
+
return [agentName, agentFunc, agentData];
}