mirror of
https://github.com/diligencia/semantic-branch-version.git
synced 2024-11-23 12:53:52 +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;
|
||||
}
|
||||
|
||||
function extractVersion(branch) {
|
||||
const regexp = /^([0-9]\.[0-9]\.[0-9])|([0-9]\.[0-9])|([0-9])$/;
|
||||
return branch.match(regexp);
|
||||
const regexp = /([0-9]\.[0-9]\.[0-9])|([0-9]\.[0-9])|([0-9])/g;
|
||||
const matches = branch.match(regexp);
|
||||
|
||||
return matches ? matches.shift() : null;
|
||||
}
|
Loading…
Reference in New Issue
Block a user