diff --git a/.husky/addReferenceTag.js b/.husky/addReferenceTag.js index 399c69301..1f35309d5 100644 --- a/.husky/addReferenceTag.js +++ b/.husky/addReferenceTag.js @@ -13,14 +13,17 @@ function getCurrentBranchName(p = process.cwd()) { return headContent.trim().split('/')[2]; } -const branchName = getCurrentBranchName(); +const branchName = 'peterParkersl'; if (branchName) { const msgPath = `.git/COMMIT_EDITMSG`; const msg = fs.readFileSync(msgPath, 'utf-8'); + const reference = branchName.match(/^\d+/)[0]; - const referenceTag = `refs #${branchName.match(/^\d+/)}`; - if (!msg.includes(referenceTag)) { + const referenceTag = `refs #${reference}`; + if (!msg.includes(referenceTag) && reference) { + console.log('reference: ', reference); + const splitedMsg = msg.split(':'); if (splitedMsg.length > 1) {