-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fallback to tags if no meta-information file found (#275)
BREAKING CHANGE: if no package.json, bower.json, etc., is found, we now fallback to git tags
- Loading branch information
Showing
7 changed files
with
118 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,6 @@ | |
"tagPrefix": "v", | ||
"scripts": {}, | ||
"skip": {}, | ||
"dryRun": false | ||
"dryRun": false, | ||
"gitTagFallback": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const gitSemverTags = require('git-semver-tags') | ||
const semver = require('semver') | ||
|
||
module.exports = function () { | ||
return new Promise((resolve, reject) => { | ||
gitSemverTags(function (err, tags) { | ||
if (err) return reject(err) | ||
else if (!tags.length) return resolve('1.0.0') | ||
// ensure that the largest semver tag is at the head. | ||
tags = tags.map(tag => { return semver.clean(tag) }) | ||
tags.sort(semver.rcompare) | ||
return resolve(tags[0]) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters