Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/scripts/lint-readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ allScripts.forEach(file => {
}
});

// Check bash syntax for all .sh files
allScripts.forEach(file => {
if (!file.endsWith('.sh')) {
return;
}

const filePath = path.join(directoryPath, file);
try {
execSync(`bash -n "${filePath}"`, { stdio: 'pipe' });
} catch (error) {
console.log(`Bash syntax error in ${file}: ${error.stderr.toString().trim()}`);
issueCount++;
}
});

// Extract the part of the README under the ## Scripts heading
const scriptsSection = readme.split(`${parentHeading}\n`)[1];

Expand Down