停车场项目web, 互联网仓库, 开发完成后, 需要将代码回传云桌面.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
526 B

  1. const spawn = require("cross-spawn")
  2. const runCmd = (command, args = []) =>
  3. new Promise((resolve, reject) => {
  4. const child = spawn(command, args, { stdio: "inherit" })
  5. child.on("close", (code) => {
  6. if (code !== 0) {
  7. return reject({ message: "error" })
  8. }
  9. return resolve({ message: "success" })
  10. })
  11. })
  12. run()
  13. async function run() {
  14. console.log("打包生成部署代码 =>>")
  15. await runCmd("npm", ["run", "build:doc"]).catch((err) => {
  16. console.log(err)
  17. process.exit(0)
  18. })
  19. }