Skip to content

Commit

Permalink
fix: electron version script
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Sep 29, 2024
1 parent 1e62503 commit c55ff0d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build/utils/get-versions.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import path from 'node:path'
import url from 'node:url'
import { execa } from './child-process.mjs'
import { getDirectory } from './common.mjs'

export default async function () {
const resolved = import.meta.resolve('electron/cli.js')
const electron = url.fileURLToPath(resolved)
const versionScript = path.resolve(getDirectory(import.meta), 'electron-versions.cjs')
const { stdout: versions } = await execa(`node ${electron} ${versionScript}`)
const { stdout: versions } = await execa(`npx electron ${versionScript}`, {
env: {
...process.env,
ELECTRON_RUN_AS_NODE: '1',
},
})
return JSON.parse(versions)
}

0 comments on commit c55ff0d

Please sign in to comment.