From 1a71be38a36901020ecba3e25b51f1e3ec484c19 Mon Sep 17 00:00:00 2001 From: pablone Date: Fri, 12 Apr 2024 12:03:34 +0200 Subject: [PATCH] feat: test --- .husky/addReferenceTag.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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) {