Closed dmitry1100 closed 1 year ago
src/index.js had the following lines:
options.include = options.include ? options.include.split(',') : []; options.exclude = options.exclude ? options.exclude.split(',') : [];
which make options.include and options.exclude defined as array. Later let's suppose that a config file has include and exclude defined. It is parsed:
const configOptions = configFile ? JSON.parse(configFile) : {};
and later the following code merges both options from command line and from config:
const { source, token, serverId, out, include, exclude, parentChannel, onlyParse } = { ...configOptions, ...options }
So, include/exclude from command line args always overwrite such properties from config file because they always defined even if not passed as args.
Thanks for PR @dmitry1100 !
src/index.js had the following lines:
which make options.include and options.exclude defined as array. Later let's suppose that a config file has include and exclude defined. It is parsed:
and later the following code merges both options from command line and from config:
So, include/exclude from command line args always overwrite such properties from config file because they always defined even if not passed as args.