mirror of
https://github.com/diligencia/semantic-branch-version.git
synced 2024-11-23 13:13: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;
|
||||
}
|
||||
|
||||
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