mirror of
https://github.com/diligencia/semantic-branch-version.git
synced 2024-11-23 16:23:50 +08:00
Merge branch 'features/v1.0.0'
This commit is contained in:
commit
bf791bd8c8
8
index.js
8
index.js
@ -27,12 +27,14 @@ async function getBranchName() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
await execlib.exec('git', ['branch'], options);
|
await execlib.exec('git', ['branch', '--show-current'], options);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function extractVersion(branch) {
|
function extractVersion(branch) {
|
||||||
const regexp = /^([0-9]\.[0-9]\.[0-9])|([0-9]\.[0-9])|([0-9])$/;
|
const regexp = /([0-9]\.[0-9]\.[0-9])|([0-9]\.[0-9])|([0-9])/g;
|
||||||
return branch.match(regexp);
|
const matches = branch.match(regexp);
|
||||||
|
|
||||||
|
return matches ? matches.shift() : null;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user