Skip to content

Commit

Permalink
Upgrade: Update copy-props (closes #123) (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
sttk authored and phated committed Dec 21, 2017
1 parent 62f0269 commit 9d6db31
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/shared/config/env-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ function mergeConfigToEnvFlags(env, config) {
return copyProps(env, config, toFrom, convert, true);
}

function convert(value, configKey, envKey) {
if (envKey === 'configBase') {
return path.dirname(value);
function convert(configInfo, envInfo) {
if (envInfo.keyChain === 'configBase') {
return path.dirname(configInfo.value);
}
return value;
return configInfo.value;
}

module.exports = mergeConfigToEnvFlags;
8 changes: 4 additions & 4 deletions lib/shared/config/load-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ function loadConfigFiles(configFiles, configFileOrder) {

copyProps(require(filePath), config, convert);

function convert(value, name) {
if (name === 'flags.gulpfile') {
return path.resolve(path.dirname(filePath), value);
function convert(loadedInfo) {
if (loadedInfo.keyChain === 'flags.gulpfile') {
return path.resolve(path.dirname(filePath), loadedInfo.value);
}
return value;
return loadedInfo.value;
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"dependencies": {
"archy": "^1.0.0",
"chalk": "^1.1.0",
"copy-props": "^1.4.1",
"copy-props": "^2.0.1",
"fancy-log": "^1.1.0",
"gulplog": "^1.0.0",
"interpret": "^1.0.0",
Expand Down

0 comments on commit 9d6db31

Please sign in to comment.