diff --git a/chrome/content/scaffold/scaffold.js b/chrome/content/scaffold/scaffold.js index 19e995ded1..014f0d93ab 100644 --- a/chrome/content/scaffold/scaffold.js +++ b/chrome/content/scaffold/scaffold.js @@ -25,6 +25,7 @@ var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); var { E10SUtils } = ChromeUtils.import("resource://gre/modules/E10SUtils.jsm"); +var { Subprocess } = ChromeUtils.import("resource://gre/modules/Subprocess.jsm"); import FilePicker from 'zotero/modules/filePicker'; @@ -2147,22 +2148,23 @@ var Scaffold = new function () { let eslintPath = await getESLintPath(); if (!eslintPath) return []; - let outputFile = OS.Path.join( - Zotero.getTempDirectory().path, - `lint_output_${Zotero.Utilities.randomString()}.json` - ); - - Zotero.debug(`Running ESLint`); + Zotero.debug('Running ESLint'); try { - await Zotero.Utilities.Internal.exec(eslintPath, ['-o', outputFile, '--', translatorPath]); + let proc = await Subprocess.call({ + command: eslintPath, + arguments: ['-o', '-', '--', translatorPath], + }); + let lintOutput = ''; + let chunk; + while ((chunk = await proc.stdout.readString())) { + lintOutput += chunk; + } + return JSON.parse(lintOutput); } catch (e) { - // ignore non-zero exit code (which just means that there were lint errors in the translator) + Zotero.logError(e); } - - let lintOutput = await Zotero.File.getContentsAsync(outputFile); - Zotero.File.removeIfExists(outputFile); - return JSON.parse(lintOutput); + return []; } function eslintOutputToModelMarkers(output) { diff --git a/translators b/translators index a41195e2f8..75eb338759 160000 --- a/translators +++ b/translators @@ -1 +1 @@ -Subproject commit a41195e2f833ae6a66ccec66cdd70aff911dffd5 +Subproject commit 75eb338759d2d99897d2f29e4be5fc6f3165b3a5