Skip to content

Commit 540bb38

Browse files
authored
diff-npm-package: polish reports dir creation (#3624)
#3623 creates the reports folder via the report path, rather than the reports folder path. This did not trigger an error, because no changes were found.
1 parent baf9e4f commit 540bb38

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

resources/diff-npm-package.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ const diff = execOutput(`npm diff --diff=${fromPackage} --diff=${toPackage}`);
3232
if (diff === '') {
3333
console.log('No changes found!');
3434
} else {
35-
const reportPath = localRepoPath('reports', 'npm-dist-diff.html');
36-
if (!fs.existsSync(reportPath)) {
37-
fs.mkdirSync(reportPath);
35+
const reportsDir = localRepoPath('reports');
36+
if (!fs.existsSync(reportsDir)) {
37+
fs.mkdirSync(reportsDir);
3838
}
39+
const reportPath = path.join(reportsDir, 'npm-dist-diff.html');
3940
fs.writeFileSync(reportPath, generateReport(diff));
4041
console.log('Report saved to: ', reportPath);
4142
}

0 commit comments

Comments
 (0)