2017-05-01 01:01:12 +03:00
|
|
|
#!/usr/bin/env node
|
2023-02-26 22:42:31 +03:00
|
|
|
import { rebuild } from 'electron-rebuild'
|
|
|
|
import * as path from 'path'
|
|
|
|
import * as vars from './vars.mjs'
|
|
|
|
|
|
|
|
import * as url from 'url'
|
|
|
|
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
|
|
|
|
|
2017-05-01 01:01:12 +03:00
|
|
|
|
2022-04-25 08:50:35 +03:00
|
|
|
if (process.platform === 'win32' || process.platform === 'linux') {
|
|
|
|
process.env.ARCH = ((process.env.ARCH || process.arch) === 'arm') ? 'armv7l' : process.env.ARCH || process.arch
|
|
|
|
} else {
|
|
|
|
process.env.ARCH ??= process.arch
|
2022-04-19 14:31:50 +03:00
|
|
|
}
|
2022-03-09 18:57:29 +03:00
|
|
|
|
2019-08-27 12:52:52 +03:00
|
|
|
let lifecycles = []
|
2021-06-30 00:57:04 +03:00
|
|
|
for (let dir of ['app', 'tabby-core', 'tabby-local', 'tabby-ssh', 'tabby-terminal']) {
|
2019-08-27 12:52:52 +03:00
|
|
|
const build = rebuild({
|
|
|
|
buildPath: path.resolve(__dirname, '../' + dir),
|
|
|
|
electronVersion: vars.electronVersion,
|
2022-03-09 18:57:29 +03:00
|
|
|
arch: process.env.ARCH,
|
2019-08-27 12:52:52 +03:00
|
|
|
force: true,
|
|
|
|
})
|
|
|
|
build.catch(e => {
|
|
|
|
console.error(e)
|
|
|
|
process.exit(1)
|
|
|
|
})
|
|
|
|
lifecycles.push([build.lifecycle, dir])
|
2018-12-15 17:49:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
console.info('Building against Electron', vars.electronVersion)
|
2018-08-09 21:53:22 +03:00
|
|
|
|
2018-12-15 17:49:06 +03:00
|
|
|
for (let [lc, dir] of lifecycles) {
|
2019-08-27 12:52:52 +03:00
|
|
|
lc.on('module-found', name => {
|
|
|
|
console.info('Rebuilding', dir + '/' + name)
|
|
|
|
})
|
2018-08-09 21:53:22 +03:00
|
|
|
}
|