Commit eab9c915 authored by Amanda Chen's avatar Amanda Chen

Merge branch 'develop'

parents 7fc0a8a5 90ffff5a
// require('shelljs/global'); 全局执行的shelljs var execSync = require("child_process").execSync;
var exec = require("child_process").exec;
function execute(cmd) { function execute(cmd) {
exec(cmd, function (error, stdout, stderr) { execSync(cmd, function (error, stdout, stderr) {
if (error) { if (error) {
console.error(error); console.error("发生错误", error);
process.exit(1);
// throw error;
} else { } else {
console.log("success"); console.log(cmd);
} }
}); });
} }
var arguments = process.argv.splice(2); var arguments = process.argv.splice(2);
console.log("所传递的参数是:", arguments);
let params = { let params = {
tag: null || "v-undefined-rc.1", tag: null,
m: null || "未知", m: null || "未知",
}; };
for (let item of arguments) { for (let item of arguments) {
...@@ -27,7 +26,9 @@ for (let item of arguments) { ...@@ -27,7 +26,9 @@ for (let item of arguments) {
} }
} }
} }
console.log("obj===", params); if (!params.tag) {
throw "tag params is required!";
}
execute("git checkout develop"); execute("git checkout develop");
execute("git pull"); execute("git pull");
...@@ -36,11 +37,4 @@ execute("git merge --no-ff develop"); ...@@ -36,11 +37,4 @@ execute("git merge --no-ff develop");
execute("git push"); execute("git push");
execute(`git tag -a ${params.tag} -m ${params.m}`); execute(`git tag -a ${params.tag} -m ${params.m}`);
execute(`git push --tags `); execute(`git push --tags `);
console.log("还是走了");
// // 执行git提交命令
// shell.exec(`git checkout master`)
// shell.exec('git merge develop')
// // shell.exec(`git commit -m "${commit}"`)
// shell.exec(`git pull`)
// shell.exec('git push')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment