From d85558d9304ff61a15335cc764066616129c3fd3 Mon Sep 17 00:00:00 2001 From: simonhaenisch Date: Mon, 23 Dec 2019 10:24:12 +0100 Subject: [PATCH] fix(cli): merge pdf_options of config file properly --- cli.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli.ts b/cli.ts index 106910b..eb65e08 100755 --- a/cli.ts +++ b/cli.ts @@ -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 = 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']}`));