feat: test

This commit is contained in:
Pablo Natek 2024-04-12 12:03:34 +02:00
parent 1728ed955b
commit 1a71be38a3
1 changed files with 6 additions and 3 deletions

View File

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