install-deps.js 753 B

123456789101112131415161718192021222324252627282930313233
  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.exec(`${npx} yarn install`)
  10. sh.cd('app')
  11. sh.exec(`${npx} yarn install`)
  12. sh.cd('..')
  13. vars.builtinPlugins.forEach(plugin => {
  14. log.info('deps', plugin)
  15. sh.cd(plugin)
  16. sh.exec(`${npx} yarn install`)
  17. sh.cd('..')
  18. })
  19. if (['darwin', 'linux'].includes(process.platform)) {
  20. sh.cd('node_modules')
  21. for (let x of vars.builtinPlugins) {
  22. sh.ln('-fs', '../' + x, x)
  23. }
  24. for (let x of vars.bundledModules) {
  25. sh.ln('-fs', '../app/node_modules/' + x, x)
  26. }
  27. sh.cd('..')
  28. }