node-etc icon indicating copy to clipboard operation
node-etc copied to clipboard

Empty yaml file causes error

Open ronaldfenner opened this issue 9 years ago • 1 comments

When merging in an empty yaml file an error is thrown from tea-merge. Error: Incompatible merge scenario. at merge (/github/gcpvp/game-server/node_modules/tea-merge/lib/merge.js:79:11) at module.exports (/github/gcpvp/game-server/node_modules/tea-merge/lib/merge.js:61:5) at Etc.push (/github/gcpvp/game-server/node_modules/etc/etc.js:33:15) at Etc.file (/github/gcpvp/game-server/node_modules/etc/etc.js:147:24)

The file is currently empty because I hadn't put anything in it yet and was setting up the code to load up the configuration files. I'm actually merging in two files to generate the full config options. The first file actually has an option set in it.

Heres the code i'm using: const etc = require('etc')(); etc.use(require('etc-yaml')); etc.file(root_dir+'common/config/config.inc.yaml'); etc.file(root_dir+'config/config.inc.yaml'); //<--- the empty file var config_json = etc.toJSON();

ronaldfenner avatar Jul 28 '16 04:07 ronaldfenner

Hey @ronaldfenner thanks for the report! I'm not using this module as actively as I used to, but I'd happily merge a PR 😄

cpsubrian avatar Jul 28 '16 04:07 cpsubrian