Commit a8aebbf8 authored by shangbj's avatar shangbj

update

parent 1d599406
......@@ -50,11 +50,11 @@ function conflictCheck() {
}
}
if(fs.existsSync(mergeMsgPath)){
mergeCheck()
} else {
// if(fs.existsSync(mergeMsgPath)){
// mergeCheck()
// } else {
commitMsgCheck()
}
// }
conflictCheck()
......
const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const logSymbols = require('log-symbols')
const execSync = require('child_process').execSync
const gitPath = path.join(process.cwd(), process.env.HUSKY_GIT_PARAMS);
const mergeMsgPath = path.join(gitPath,'../','MERGE_MSG')
function mergeCheck(){
const mergeMsg = fs.readFileSync(mergeMsgPath, 'utf-8');
console.log(logSymbols.info, chalk.blue('开始分支检测...'))
let curBranch = execSync("git symbolic-ref HEAD | sed -e \'s,.*/\(.*\),\1,\'", {encoding: 'utf-8'})
console.log('curBranch', curBranch)
console.log('mergeBranch' ,mergeMsg)
// process.exit(1)
}
mergeCheck()
process.exit(0)
\ No newline at end of file
......@@ -12,7 +12,8 @@
},
"husky": {
"hooks": {
"commit-msg": "node ./build/commit-hook.js $HUSKY_GIT_PARAMS"
"commit-msg": "node ./build/commit-hook.js $HUSKY_GIT_PARAMS",
"prepare-commit-msg": "node ./build/merge-hook.js $HUSKY_GIT_PARAMS"
}
},
"keywords": [],
......
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