1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-24 06:04:04 +03:00
tabby/scripts/prepackage-plugins.js
Eugene Pankov 6f2008e5a2 .
2017-06-23 23:52:51 +02:00

25 lines
758 B
JavaScript
Executable File

#!/usr/bin/env node
const rebuild = require('electron-rebuild').default
const sh = require('shelljs')
const path = require('path')
const fs = require('fs')
const vars = require('./vars')
const log = require('npmlog')
let target = path.resolve(__dirname, '../builtin-plugins')
sh.mkdir('-p', target)
fs.writeFileSync(path.join(target, 'package.json'), '{}')
sh.cd(target)
vars.builtinPlugins.forEach(plugin => {
log.info('install', plugin)
sh.cp('-r', path.join('..', plugin), '.')
sh.rm('-rf', path.join(plugin, 'node_modules'))
sh.cd(plugin)
sh.exec(`npm install --only=prod`)
log.info('rebuild', 'native')
if (fs.existsSync('node_modules')) {
rebuild(path.resolve('.'), vars.electronVersion, process.arch, [], true)
}
sh.cd('..')
})