Disable behaviors entirely if --behaviors array is empty (#672)

Fixes #651
This commit is contained in:
Tessa Walsh 2024-08-27 16:20:19 -04:00 committed by GitHub
parent c61a03de6e
commit 39c8f48bb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 5 deletions

View file

@ -630,10 +630,14 @@ class ArgParser {
// background behaviors to apply
const behaviorOpts: { [key: string]: string | boolean } = {};
argv.behaviors.forEach((x: string) => (behaviorOpts[x] = true));
behaviorOpts.log = BEHAVIOR_LOG_FUNC;
behaviorOpts.startEarly = true;
argv.behaviorOpts = JSON.stringify(behaviorOpts);
if (argv.behaviors.length > 0) {
argv.behaviors.forEach((x: string) => (behaviorOpts[x] = true));
behaviorOpts.log = BEHAVIOR_LOG_FUNC;
behaviorOpts.startEarly = true;
argv.behaviorOpts = JSON.stringify(behaviorOpts);
} else {
argv.behaviorOpts = "";
}
argv.text = argv.text || [];