tabby/scripts/install-deps.js

34 lines
753 B
JavaScript
Raw Normal View History

2017-05-01 06:01:12 +08:00
#!/usr/bin/env node
const sh = require('shelljs')
const path = require('path')
const vars = require('./vars')
2017-06-10 06:29:16 +08:00
const log = require('npmlog')
2017-05-01 06:01:12 +08:00
const localBinPath = path.resolve(__dirname, '../node_modules/.bin');
const npx = `${localBinPath}/npx`;
2017-06-10 06:29:16 +08:00
log.info('deps', 'app')
sh.exec(`${npx} yarn install`)
2017-05-01 06:01:12 +08:00
2017-06-21 05:28:58 +08:00
sh.cd('app')
sh.exec(`${npx} yarn install`)
2017-06-21 05:28:58 +08:00
sh.cd('..')
2017-05-01 06:01:12 +08:00
vars.builtinPlugins.forEach(plugin => {
2017-06-10 06:29:16 +08:00
log.info('deps', plugin)
2017-05-01 06:01:12 +08:00
sh.cd(plugin)
sh.exec(`${npx} yarn install`)
2017-05-01 06:01:12 +08:00
sh.cd('..')
})
2018-03-24 00:15:11 +08:00
if (['darwin', 'linux'].includes(process.platform)) {
sh.cd('node_modules')
for (let x of vars.builtinPlugins) {
sh.ln('-fs', '../' + x, x)
}
for (let x of vars.bundledModules) {
sh.ln('-fs', '../app/node_modules/' + x, x)
}
sh.cd('..')
}