syncTNPM.js 554 Bytes
Newer Older
dengxiaofeng's avatar
dengxiaofeng committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
const { execa } = require('@umijs/utils');
const { join } = require('path');
const getPackages = require('./utils/getPackages');

process.setMaxListeners(Infinity);

module.exports = (publishPkgList) => {
  const pkgList = (publishPkgList || getPackages()).map((name) => {
    return require(join(__dirname, '../packages', name, 'package.json')).name;
  });
  const commands = pkgList.map((pkg) => {
    const subprocess = execa('tnpm', ['sync', pkg]);
    subprocess.stdout.pipe(process.stdout);
    return subprocess;
  });
  Promise.all(commands);
邓晓峰's avatar
邓晓峰 committed
17
};