1 | const R = require('ramda')
|
2 | const semver = require('semver')
|
3 |
|
4 | // text: output of command "git tag"
|
5 | function sortTagsByVersion (text) {
|
6 | const tags = R.reject(R.isEmpty, R.map(R.trim, R.split('\n', R.trim(text))))
|
7 | return tags.sort(semver.compare)
|
8 | }
|
9 |
|
10 | module.exports = sortTagsByVersion
|