const shell = require('shelljs'); //shell脚本
const execSync = require('child_process').execSync;
const fs = require('fs');
console.log('------------自动读取之前 package.json 版本 ------------');
const packageJsonStr = fs.readFileSync('./package.json').toString(); //获取版本
const packageArr = fs.readFileSync(
判断package.json文件是否改变,禁止非管理员提交
![](https://img-home.csdnimg.cn/images/20240711042549.png)