Skip to content

Commit

Permalink
2.1.1 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimung authored Jan 11, 2018
1 parent 8737a57 commit 4989072
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 2.1.1 - 2018-01-11
### Changed
- add appRelative parameter for path.resolve

## 2.1.0 - 2018-01-01
### Added
- path resolve
Expand Down
4 changes: 2 additions & 2 deletions lib/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ ConfigurationManager.prototype.init = function(env) {
let configFileName = path + config.prefix + '.' + env + config.ext;

if (fs.existsSync(defaultConfigFileName)) {
document = yaml.load(defaultConfigFileName);
document = yaml.load(defaultConfigFileName, true);
}

if(defaultConfigFileName !== configFileName && fs.existsSync(configFileName)) {
document = extend(true, document || {}, yaml.load(configFileName));
document = extend(true, document || {}, yaml.load(configFileName, true));
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/sections/field/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
var errors = require('@rduk/errors');

module.exports = {
resolve: function(path) {
resolve: function(path, appRelative) {
if (!path || typeof path !== 'string') {
errors.throwArgumentError('path', path);
}

if (/^\w/.test(path)) {
if (/^\w/.test(path) && appRelative) {
path = '~/' + path;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/sections/field/type.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var errors = require('@rduk/errors');
var path = require('./path');

module.exports = {
load: function(filepath) {
return require(path.resolve(filepath));
load: function(filepath, appRelative) {
return require(path.resolve(filepath, appRelative));
}
};
4 changes: 2 additions & 2 deletions lib/sections/field/yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var path = require('./path');
var loadYaml = require('../../utils/loadYaml');

module.exports = {
load: function(filepath) {
return loadYaml(path.resolve(filepath));
load: function(filepath, appRelative) {
return loadYaml(path.resolve(filepath, appRelative));
}
};
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rduk/configuration",
"version": "2.1.0",
"version": "2.1.1",
"description": "Manage configuration in your Node.js app",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit 4989072

Please sign in to comment.