Skip to content

Commit

Permalink
Merge branch 'alpha' into revert-beforeSave
Browse files Browse the repository at this point in the history
  • Loading branch information
dblythy committed Mar 26, 2022
2 parents 47ab4de + 9ef1968 commit 6ee087d
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 6ee087d

Please sign in to comment.