From ae09ff88e58d922ce23d7a702d5361b512be8248 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Tue, 31 May 2022 15:45:21 +0300 Subject: [PATCH 1/2] diff-npm-package: create reports folder --- resources/diff-npm-package.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/diff-npm-package.ts b/resources/diff-npm-package.ts index ff448dc10f..f0bf843fd9 100644 --- a/resources/diff-npm-package.ts +++ b/resources/diff-npm-package.ts @@ -33,6 +33,9 @@ if (diff === '') { console.log('No changes found!'); } else { const reportPath = localRepoPath('reports', 'npm-dist-diff.html'); + if (!fs.existsSync) { + fs.mkdirSync(reportPath); + } fs.writeFileSync(reportPath, generateReport(diff)); console.log('Report saved to: ', reportPath); } From 97f032c60b4efddee47740bd529d2ed4a2c7e614 Mon Sep 17 00:00:00 2001 From: Saihajpreet Singh Date: Wed, 1 Jun 2022 05:36:22 -0700 Subject: [PATCH 2/2] Apply suggestions from code review --- resources/diff-npm-package.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/diff-npm-package.ts b/resources/diff-npm-package.ts index f0bf843fd9..dabf2cb2b7 100644 --- a/resources/diff-npm-package.ts +++ b/resources/diff-npm-package.ts @@ -33,7 +33,7 @@ if (diff === '') { console.log('No changes found!'); } else { const reportPath = localRepoPath('reports', 'npm-dist-diff.html'); - if (!fs.existsSync) { + if (!fs.existsSync(reportPath)) { fs.mkdirSync(reportPath); } fs.writeFileSync(reportPath, generateReport(diff));