Skip to main content
Sign in
Snippets Groups Projects
Commit 19f66193 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Merge branch 'test' into 'master'

Add test script.

See merge request openfisca/openfisca-france-reforms!4
parents b13f2b24 6814f326
Branches
Tags
1 merge request!4Add test script.
Pipeline #1064 failed
import { $ } from "zx"
async function latestVersionObjectFromTags() {
return (await $`git tag --list`).stdout
.split("\n")
.filter((line) => line.match(/^\d+\.\d+\.\d+$/))
.map((version) => {
const match = version.match(/^(\d+)\.(\d+)\.(\d+)$/) as string[]
return {
major: parseInt(match[1]),
minor: parseInt(match[2]),
patch: parseInt(match[3]),
}
})
.sort((groups1, groups2) =>
groups1.major !== groups2.major
? groups2.major - groups1.major
: groups1.minor !== groups2.minor
? groups2.minor - groups1.minor
: groups2.patch - groups1.patch,
)[0]
}
async function main() {
const { major, minor, patch } = await latestVersionObjectFromTags()
console.log("a", major, minor, patch)
const nextVersion = `${major}.${minor}.${patch + 1}`
console.log("b", nextVersion)
}
main()
.then(() => {
process.exit(0)
})
.catch((error: unknown) => {
console.error(error)
process.exit(1)
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment