mirror of
https://gh-proxy.org/https://github.com/klinsmaya/workdsh.git
synced 2026-11-09 09:57:05 +08:00
24 lines
774 B
JavaScript
24 lines
774 B
JavaScript
/** Build an unsigned unpacked application for the current host platform. */
|
|
|
|
import { spawnSync } from 'node:child_process'
|
|
import { createRequire } from 'node:module'
|
|
import { dirname } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const require = createRequire(import.meta.url)
|
|
const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)))
|
|
const builderCli = require.resolve('electron-builder/cli.js')
|
|
const result = spawnSync(process.execPath, [builderCli, '--dir'], {
|
|
cwd: packageRoot,
|
|
env: {
|
|
...process.env,
|
|
CSC_IDENTITY_AUTO_DISCOVERY: 'false',
|
|
},
|
|
stdio: 'inherit',
|
|
})
|
|
|
|
if (result.error !== undefined) throw result.error
|
|
if (result.status !== 0) {
|
|
throw new Error(`electron-builder --dir exited with ${String(result.status)}`)
|
|
}
|