Skip to content

Commit

Permalink
Update everything, actually exit
Browse files Browse the repository at this point in the history
  • Loading branch information
Doridian committed Apr 2, 2024
1 parent 7681e35 commit fbb3740
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/glualint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 16
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- name: npm for Lua lint
run: |
set +ex
export PATH=$PATH:/tmp/bin
mkdir -p /tmp/bin
pushd /tmp/bin
wget -q https://github.com/FPtje/GLuaFixer/releases/download/1.24.6/glualint-1.24.6-x86_64-linux.zip -O glualint.zip
wget -q https://github.com/FPtje/GLuaFixer/releases/download/1.28.0/glualint-1.28.0-x86_64-linux.zip -O glualint.zip
unzip glualint.zip
chmod +x glualint
popd
Expand Down
14 changes: 7 additions & 7 deletions gluaLintEx.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,26 +94,26 @@ function endCheck() {
}, checkId).catch(e => console.error(e));
}

const res = spawnSync('glualint', ['.']);
if (res.status === null) {
const gLuaLintRes = spawnSync('glualint', ['.']);
if (gLuaLintRes.status === null) {
errorCount++;
console.error('Interrupted');
endCheck().then(() => process.exit(1));
return;
}
if (res.status === 0) {
if (gLuaLintRes.status === 0) {
endCheck().then(() => process.exit(0));
return;
}

if (res.status !== 1) {
if (gLuaLintRes.status !== 1) {
errorCount++;
endCheck().then(() => process.exit(res.status));
endCheck().then(() => process.exit(gLuaLintRes.status));
return;
}

const errRegExp = /^(.+): \[(Warning|Error)\] line (\d+), column (\d+) - line (\d+), column (\d+): (.+)$/;
const output = res.stdout.toString().trim().split(/\r?\n/).filter(l => !!l).map(l => l.match(errRegExp)).map(m => ({
const output = gLuaLintRes.stdout.toString().trim().split(/\r?\n/).filter(l => !!l).map(l => l.match(errRegExp)).map(m => ({
file: normalize(m[1]),
type: m[2].toLowerCase(),
lineStart: parseInt(m[3], 10),
Expand Down Expand Up @@ -166,4 +166,4 @@ for (const r of reportErrors) {
console.log(`${r.type} ${r.file}:${r.lineStart}:${r.columnStart}-${r.lineEnd}:${r.columnEnd} ${r.message}`);
}

endCheck();
endCheck().then(() => process.exit(gLuaLintRes.status));

0 comments on commit fbb3740

Please sign in to comment.