Skip to content

Commit

Permalink
chore: Add error handling for missing previous gas report
Browse files Browse the repository at this point in the history
  • Loading branch information
Aboudjem committed Jun 1, 2024
1 parent df69234 commit 0cc4eb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/foundry/compareGasReports.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
const fs = require('fs');

function compareGasReports(prevFile, currFile) {
if (!fs.existsSync(prevFile)) {
console.error('No previous gas report found.');
return 'No previous gas report found. Skipping comparison.';
}

const prevData = fs.readFileSync(prevFile, 'utf8');
const currData = fs.readFileSync(currFile, 'utf8');

Expand Down

0 comments on commit 0cc4eb1

Please sign in to comment.