fix: use first commit if no tags are present
This commit is contained in:
Родитель
d44758a35e
Коммит
f5acb1419c
|
@ -12,7 +12,17 @@ const until = f => array => {
|
|||
return [ first, ...until(f)(array.slice(1)) ];
|
||||
};
|
||||
|
||||
const lastTaggedRelease = () => execSync('git rev-list -1 `git describe --tags --abbrev=0 --match "v[0-9]*"`', { encoding: 'utf8' }).trim();
|
||||
const lastTaggedRelease = () => {
|
||||
let sha;
|
||||
|
||||
try {
|
||||
sha = execSync('git rev-list -1 `git describe --tags --abbrev=0 --match "v[0-9]*"`', {
|
||||
encoding: 'utf8'
|
||||
}).trim();
|
||||
} catch(e) {}
|
||||
|
||||
return sha;
|
||||
};
|
||||
|
||||
module.exports = function (pluginConfig, config, cb) {
|
||||
// run standard commit analysis
|
||||
|
|
16
lastTag.js
16
lastTag.js
|
@ -1,8 +1,16 @@
|
|||
const execSync = require('child_process').execSync;
|
||||
|
||||
const lastTag = () => execSync(
|
||||
'git describe --tags --match "v[0-9]*" --exclude="*dev*" --abbrev=0 origin/master',
|
||||
{ encoding: 'utf8' }
|
||||
).trim();
|
||||
const lastTag = () => {
|
||||
let sha;
|
||||
|
||||
try {
|
||||
sha = execSync(
|
||||
'git describe --tags --match "v[0-9]*" --exclude="*dev*" --abbrev=0 origin/master',
|
||||
{ encoding: 'utf8' }
|
||||
).trim();
|
||||
} catch(e) {}
|
||||
|
||||
return sha;
|
||||
}
|
||||
|
||||
module.exports = lastTag;
|
||||
|
|
Загрузка…
Ссылка в новой задаче