Skip to content

Commit 270e1dc

Browse files
joeson1kyliau
authored andcommitted
fix(@schematics/update): ensure option is string when replacing environment 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
1 parent 9b77570 commit 270e1dc

File tree

1 file changed

+3
-1
lines changed
  • packages/schematics/update/update

1 file changed

+3
-1
lines changed

packages/schematics/update/update/npm.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ function readOptions(
8484

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

9092
return options;

0 commit comments

Comments
 (0)