diff --git a/.github/workflows/glualint.yml b/.github/workflows/glualint.yml index 5df02cc9..ae5c5bbe 100644 --- a/.github/workflows/glualint.yml +++ b/.github/workflows/glualint.yml @@ -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 diff --git a/gluaLintEx.js b/gluaLintEx.js index addbff1a..316f52a5 100644 --- a/gluaLintEx.js +++ b/gluaLintEx.js @@ -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), @@ -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));