Skip to content

Commit

Permalink
Merge pull request #23 from psi-4ward/feat/yaml-anchors
Browse files Browse the repository at this point in the history
feat(config): Support yaml-anchors
  • Loading branch information
dixi83 authored Jan 14, 2025
2 parents fc6adb6 + 9e0cec1 commit 41d2670
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let config = function() {

if (extension === "yaml" || extension === ".yml") {
if (fs.existsSync(commander.opts().config)) {
return yaml.parse(fs.readFileSync(commander.opts().config, "utf8"));
return yaml.parse(fs.readFileSync(commander.opts().config, "utf8"), {merge: true});
} else {
sf.error("Config file '" + commander.opts().config + "' not found")
}
Expand All @@ -46,9 +46,9 @@ let config = function() {
if (fs.existsSync('./config.json')) {
return require('./config');
} else if (fs.existsSync('./config.yaml')) {
return yaml.parse(fs.readFileSync('./config.yaml', "utf8"));
return yaml.parse(fs.readFileSync('./config.yaml', "utf8"), {merge: true});
} else if (fs.existsSync('./config.yml')) {
return yaml.parse(fs.readFileSync('./config.yml', "utf8"));
return yaml.parse(fs.readFileSync('./config.yml', "utf8"), {merge: true});
} else {
sf.error("No config file found...")
}
Expand All @@ -57,4 +57,4 @@ let config = function() {

module.exports = {
config: config
}
}

0 comments on commit 41d2670

Please sign in to comment.