Skip to content

Commit

Permalink
Merge 744b54c into 852bb47
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrezza authored Mar 25, 2022
2 parents 852bb47 + 744b54c commit e7c92a4
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions ci/nodeEngineCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,21 @@ class NodeEngineCheck {

// For each file
for (const file of files) {

// Get node version
const contentString = await fs.readFile(file, 'utf-8');
const contentJson = JSON.parse(contentString);
const version = ((contentJson || {}).engines || {}).node;

// Add response
response.push({
file: file,
nodeVersion: version
});
try {
const contentJson = JSON.parse(contentString);
const version = ((contentJson || {}).engines || {}).node;

// Add response
response.push({
file: file,
nodeVersion: version
});
} catch(e) {
console.log(`Ignoring file because it is not valid JSON: ${file}`);
core.warning(`Ignoring file because it is not valid JSON: ${file}`);
}
}

// If results should be cleaned by removing undefined node versions
Expand Down

0 comments on commit e7c92a4

Please sign in to comment.