From d07e7b834831230b53860d0919a68edc2d36193d Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sat, 8 Jan 2022 21:36:43 +0100 Subject: build: Eslint fixes for multi-module project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kristóf Marussy --- scripts/update-electron-vendors.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts/update-electron-vendors.js') diff --git a/scripts/update-electron-vendors.js b/scripts/update-electron-vendors.js index 70d3afc..91cdb61 100644 --- a/scripts/update-electron-vendors.js +++ b/scripts/update-electron-vendors.js @@ -1,9 +1,10 @@ import { execSync } from 'child_process'; -import electronPath from 'electron'; import { writeFile } from 'fs/promises'; import { join } from 'path'; -import { fileURLToDirname } from '../config/utils.js'; +import electronPath from 'electron'; + +import fileURLToDirname from '../config/fileURLToDirname.js'; const thisDir = fileURLToDirname(import.meta.url); @@ -15,11 +16,12 @@ const thisDir = fileURLToDirname(import.meta.url); * @returns {NodeJS.ProcessVersions} */ function getVendors() { - const output = execSync(`${electronPath} -p "JSON.stringify(process.versions)"`, { - env: { 'ELECTRON_RUN_AS_NODE': '1' }, + const output = execSync(`${electronPath.toString()} -p "JSON.stringify(process.versions)"`, { + env: { ELECTRON_RUN_AS_NODE: '1' }, encoding: 'utf-8', }); + // eslint-disable-next-line @typescript-eslint/no-unsafe-return -- Read untyped output. return JSON.parse(output); } @@ -39,10 +41,10 @@ function updateVendors() { return Promise.all([ writeFile( join(thisDir, '../.electron-vendors.cache.json'), - JSON.stringify({ + `${JSON.stringify({ chrome: chromeMajorVersion, node: nodeMajorVersion, - }, null, 2) + '\n', + }, null, 2)}\n`, ), writeFile(browserslistrcPath, `Chrome ${chromeMajorVersion}\n`, 'utf8'), -- cgit v1.2.3-54-g00ecf