2017-05-01 06:01:12 +08:00
|
|
|
#!/usr/bin/env node
|
|
|
|
const rebuild = require('electron-rebuild').default
|
|
|
|
const path = require('path')
|
|
|
|
const vars = require('./vars')
|
|
|
|
|
2022-04-23 16:35:44 +08:00
|
|
|
process.env.ARCH = process.env.ARCH || process.arch
|
|
|
|
if (process.env.ARCH === 'arm') {
|
|
|
|
process.env.ARCH = 'armv7l'
|
2022-04-19 19:31:50 +08:00
|
|
|
}
|
2022-03-09 23:57:29 +08:00
|
|
|
|
2019-08-27 17:52:52 +08:00
|
|
|
let lifecycles = []
|
2021-06-30 05:57:04 +08:00
|
|
|
for (let dir of ['app', 'tabby-core', 'tabby-local', 'tabby-ssh', 'tabby-terminal']) {
|
2019-08-27 17:52:52 +08:00
|
|
|
const build = rebuild({
|
|
|
|
buildPath: path.resolve(__dirname, '../' + dir),
|
|
|
|
electronVersion: vars.electronVersion,
|
2022-03-09 23:57:29 +08:00
|
|
|
arch: process.env.ARCH,
|
2019-08-27 17:52:52 +08:00
|
|
|
force: true,
|
|
|
|
})
|
|
|
|
build.catch(e => {
|
|
|
|
console.error(e)
|
|
|
|
process.exit(1)
|
|
|
|
})
|
|
|
|
lifecycles.push([build.lifecycle, dir])
|
2018-12-15 22:49:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
console.info('Building against Electron', vars.electronVersion)
|
2018-08-10 02:53:22 +08:00
|
|
|
|
2018-12-15 22:49:06 +08:00
|
|
|
for (let [lc, dir] of lifecycles) {
|
2019-08-27 17:52:52 +08:00
|
|
|
lc.on('module-found', name => {
|
|
|
|
console.info('Rebuilding', dir + '/' + name)
|
|
|
|
})
|
2018-08-10 02:53:22 +08:00
|
|
|
}
|