install-deps.js 631 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env node
  2. const sh = require('shelljs')
  3. const path = require('path')
  4. const vars = require('./vars')
  5. const log = require('npmlog')
  6. const localBinPath = path.resolve(__dirname, '../node_modules/.bin');
  7. const npx = `${localBinPath}/npx`;
  8. log.info('deps', 'app')
  9. sh.cd('app')
  10. sh.exec(`${npx} yarn install`)
  11. sh.cd('..')
  12. vars.builtinPlugins.forEach(plugin => {
  13. log.info('deps', plugin)
  14. sh.cd(plugin)
  15. sh.exec(`${npx} yarn install`)
  16. sh.cd('..')
  17. })
  18. if (['darwin', 'linux'].includes(process.platform)) {
  19. sh.cd('node_modules')
  20. for (let x of vars.builtinPlugins) {
  21. sh.ln('-fs', '../' + x, x)
  22. }
  23. sh.cd('..')
  24. }