Skip to content

Commit

Permalink
fix(cli): merge pdf_options of config file properly
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhaenisch committed Dec 23, 2019
1 parent a7a5817 commit d85558d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli.ts
Expand Up @@ -75,7 +75,13 @@ async function main(args: typeof cliFlags, config: Config) {
// merge config from config file
if (args['--config-file']) {
try {
config = { ...config, ...require(path.resolve(args['--config-file'])) };
const configFile: Partial<Config> = require(path.resolve(args['--config-file']));

config = {
...config,
...configFile,
pdf_options: { ...config.pdf_options, ...configFile.pdf_options },
};
} catch (error) {
console.warn(chalk.red(`Warning: couldn't read config file: ${args['--config-file']}`));

Expand Down

0 comments on commit d85558d

Please sign in to comment.