Skip to content

Commit

Permalink
fix(@schematics/update): ensure option is string when replacing envir…
Browse files Browse the repository at this point in the history
…onment variable references

When substituting environment variables in npmrc options, string replace was also applied on boolean values. This caused the ng update process to fail
  • Loading branch information
joeson1 authored and kyliau committed Jan 11, 2019
1 parent 9b77570 commit 270e1dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/schematics/update/update/npm.ts
Expand Up @@ -84,7 +84,9 @@ function readOptions(

// Substitute any environment variable references
for (const key in options) {
options[key] = options[key].replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
if (typeof options[key] === 'string') {
options[key] = options[key].replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
}
}

return options;
Expand Down

0 comments on commit 270e1dc

Please sign in to comment.