Skip to content

Commit

Permalink
fix: check if lerna file found after parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Apr 21, 2020
1 parent a0f79aa commit ff5921f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/manager/npm/post-update/index.ts
Expand Up @@ -150,15 +150,17 @@ export async function writeExistingFiles(
const massagedFile: PackageJson = JSON.parse(
await platform.getFile(packageFile.packageFile)
);
if (massagedFile.name) {
massagedFile.name = massagedFile.name.replace(/[{}]/g, '');
if (massagedFile) {
if (massagedFile.name) {
massagedFile.name = massagedFile.name.replace(/[{}]/g, '');
}
delete massagedFile.engines;
delete massagedFile.scripts;
await fs.outputFile(
upath.join(basedir, 'package.json'),
JSON.stringify(massagedFile)
);
}
delete massagedFile.engines;
delete massagedFile.scripts;
await fs.outputFile(
upath.join(basedir, 'package.json'),
JSON.stringify(massagedFile)
);
const npmrc = packageFile.npmrc || config.npmrc;
if (npmrc) {
await fs.outputFile(upath.join(basedir, '.npmrc'), npmrc);
Expand Down

0 comments on commit ff5921f

Please sign in to comment.