mirror of
https://github.com/webrecorder/browsertrix-crawler.git
synced 2025-11-01 12:40:53 +00:00
Disable behaviors entirely if --behaviors array is empty (#672)
Fixes #651
This commit is contained in:
parent
c61a03de6e
commit
39c8f48bb2
3 changed files with 15 additions and 5 deletions
|
|
@ -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 || [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue