uploadPlglib.js 501 B

12345678910111213141516171819202122
  1. const path = require('path')
  2. const fs = require('fs/promises')
  3. const cp = require('child_process')
  4. let d1 = fs.rm(path.join(__dirname, 'node_modules', '_plglib@0.0.69@plglib'), {
  5. force: true,
  6. recursive: true,
  7. })
  8. let d2 = fs.rm(path.join(__dirname, 'node_modules', 'plglib'), {
  9. force: true,
  10. recursive: true,
  11. })
  12. Promise.all([d1, d2]).then(err => {
  13. if (err[0] || err[1]) {
  14. console.log('删除文件失败')
  15. return;
  16. }
  17. cp.exec('plgnpm i', err => {
  18. });
  19. });