saveOSSAGitte.js 513 B

123456789101112131415161718192021222324
  1. /**
  2. * build成功后的运行逻辑
  3. */
  4. const { execSync } = require("child_process");
  5. (async function Init() {
  6. /**
  7. * 上传git
  8. */
  9. function execFun() {
  10. try {
  11. execSync("git add .");
  12. execSync(`git commit -m "${process.argv[2] || '提交'}"`);
  13. execSync("git push -u origin master");
  14. execSync("git push -u github master");
  15. console.log("上传git---完成");
  16. } catch (e) {
  17. console.log("上传git---失败");
  18. console.error(e);
  19. }
  20. }
  21. execFun();
  22. })();