aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-31 03:05:14 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-31 03:05:14 +0100
commitf1c2660e942c91c027ab6b70d17faf0fc3e441ed (patch)
treec3c0dd7674bf065fd72a44213a6c3be0c8a7872c
parentbuild: Use nodenext module resolution (diff)
downloadsophie-f1c2660e942c91c027ab6b70d17faf0fc3e441ed.tar.gz
sophie-f1c2660e942c91c027ab6b70d17faf0fc3e441ed.tar.zst
sophie-f1c2660e942c91c027ab6b70d17faf0fc3e441ed.zip
fix: File paths in upgrade-electron-vendors script
-rw-r--r--scripts/update-electron-vendors.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/update-electron-vendors.js b/scripts/update-electron-vendors.js
index b2f4ca4..bdf1d2d 100644
--- a/scripts/update-electron-vendors.js
+++ b/scripts/update-electron-vendors.js
@@ -1,10 +1,12 @@
1import { execSync } from 'child_process'; 1import { execSync } from 'child_process';
2import electronPath from 'electron'; 2import electronPath from 'electron';
3import { writeFile } from 'fs/promises'; 3import { writeFile } from 'fs/promises';
4import { join, resolve } from 'path'; 4import { join } from 'path';
5 5
6import { fileURLToDirname } from '../config/utils.js'; 6import { fileURLToDirname } from '../config/utils.js';
7 7
8const thisDir = fileURLToDirname(import.meta.url);
9
8/** 10/**
9 * Returns versions of electron vendors 11 * Returns versions of electron vendors
10 * The performance of this feature is very poor and can be improved 12 * The performance of this feature is very poor and can be improved
@@ -32,11 +34,11 @@ function updateVendors() {
32 const nodeMajorVersion = electronRelease.node.split('.')[0]; 34 const nodeMajorVersion = electronRelease.node.split('.')[0];
33 const chromeMajorVersion = electronRelease.v8.split('.')[0] + electronRelease.v8.split('.')[1]; 35 const chromeMajorVersion = electronRelease.v8.split('.')[0] + electronRelease.v8.split('.')[1];
34 36
35 const browserslistrcPath = resolve(process.cwd(), '.browserslistrc'); 37 const browserslistrcPath = join(thisDir, '../.browserslistrc');
36 38
37 return Promise.all([ 39 return Promise.all([
38 writeFile( 40 writeFile(
39 join(fileURLToDirname(import.meta.url), '../.electron-vendors.cache.json'), 41 join(thisDir, '../.electron-vendors.cache.json'),
40 JSON.stringify({ 42 JSON.stringify({
41 chrome: chromeMajorVersion, 43 chrome: chromeMajorVersion,
42 node: nodeMajorVersion, 44 node: nodeMajorVersion,