From 9d6db31004397b9fe5de597b5cad9b6aff21bd57 Mon Sep 17 00:00:00 2001 From: Takayuki Sato Date: Thu, 24 Aug 2017 07:16:01 +0900 Subject: [PATCH] Upgrade: Update copy-props (closes #123) (#131) --- lib/shared/config/env-flags.js | 8 ++++---- lib/shared/config/load-files.js | 8 ++++---- package.json | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/shared/config/env-flags.js b/lib/shared/config/env-flags.js index c404e5f2..8af665e2 100644 --- a/lib/shared/config/env-flags.js +++ b/lib/shared/config/env-flags.js @@ -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; diff --git a/lib/shared/config/load-files.js b/lib/shared/config/load-files.js index 3810c93e..4ebb29cb 100644 --- a/lib/shared/config/load-files.js +++ b/lib/shared/config/load-files.js @@ -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; } } diff --git a/package.json b/package.json index 5f566639..ebfa3c0c 100644 --- a/package.json +++ b/package.json @@ -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",