build script fixes

This commit is contained in:
Eugene Pankov 2018-12-15 15:49:06 +01:00
parent 384744ec44
commit d4db8f4b18
2 changed files with 13 additions and 19 deletions

View file

@ -4,24 +4,18 @@ const path = require('path')
const vars = require('./vars')
lifecycles = []
lifecycles.push(rebuild({
buildPath: path.resolve(__dirname, '../app'),
electronVersion: vars.electronVersion,
force: true,
}).lifecycle)
lifecycles.push(rebuild({
buildPath: path.resolve(__dirname, '../terminus-ssh'),
electronVersion: vars.electronVersion,
force: true,
}).lifecycle)
lifecycles.push(rebuild({
buildPath: path.resolve(__dirname, '../terminus-terminal'),
electronVersion: vars.electronVersion,
force: true,
}).lifecycle)
for (let dir of ['app', 'terminus-ssh', 'terminus-terminal']) {
lifecycles.push([rebuild({
buildPath: path.resolve(__dirname, '../' + dir),
electronVersion: vars.electronVersion,
force: true,
}).lifecycle, dir])
}
for (let lc of lifecycles) {
console.info('Building against Electron', vars.electronVersion)
for (let [lc, dir] of lifecycles) {
lc.on('module-found', name => {
console.info('Rebuilding', name)
console.info('Rebuilding', dir + '/' + name)
})
}

View file

@ -3,7 +3,7 @@ const fs = require('fs')
const childProcess = require('child_process')
const appInfo = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../app/package.json')))
const pkgInfo = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../package.json')))
const electronInfo = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../node_modules/electron/package.json')))
exports.version = childProcess.execSync('git describe --tags', {encoding:'utf-8'})
exports.version = exports.version.substring(1, exports.version.length - 1)
@ -20,4 +20,4 @@ exports.bundledModules = [
'@angular',
'@ng-bootstrap',
]
exports.electronVersion = pkgInfo.devDependencies.electron
exports.electronVersion = electronInfo.version