Skip to content

Commit c1c0c8e

Browse files
committed
fix replaceEnvVar when not a string
1 parent fb20250 commit c1c0c8e

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [v2.0.2](https://github.com/push2cloud/compiler/compare/v2.0.1...v2.0.2)
2+
- fix replaceEnvVar when not a string
3+
14
## [v2.0.1](https://github.com/push2cloud/compiler/compare/v2.0.0...v2.0.1)
25
- regression fix for postAction plugins
36

lib/replaceEnvVar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const underscored = require('underscore.string/underscored');
2+
const _ = require('lodash');
23

34
const replaceEnvVar = (
45
envReplacement
@@ -10,7 +11,7 @@ const replaceEnvVar = (
1011
const appNameCapitalized = underscored(appName).toUpperCase();
1112
const TEMPLATE_REGEXP = /\$\{(\w*)\}/g;
1213

13-
if (value && !value.replace) return JSON.stringify(value);
14+
if (!_.isString(value)) return JSON.stringify(value);
1415

1516
return value.replace(TEMPLATE_REGEXP, (str, match) => {
1617
const autoKey = match.replace(appNameCapitalized, '${APPNAME}');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"repository": "push2cloud/compiler",
2020
"homepage": "http://push2.cloud/",
2121
"devDependencies": {
22-
"eslint": "3.3.1"
22+
"eslint": "3.5.0"
2323
},
2424
"dependencies": {
2525
"async": "2.0.1",

0 commit comments

Comments
 (0)