mirror of
https://github.com/ouchadam/small-talk.git
synced 2024-12-17 20:38:30 +01:00
Updating version name format to use chronological and numerical ordering
This commit is contained in:
parent
a64ee133ed
commit
e15806888a
@ -135,14 +135,18 @@ const createBranch = async (github, branchName, fromBranch) => {
|
|||||||
|
|
||||||
const incrementVersionFile = async (github, branchName) => {
|
const incrementVersionFile = async (github, branchName) => {
|
||||||
const versionFile = await readVersionFile(github, branchName)
|
const versionFile = await readVersionFile(github, branchName)
|
||||||
const [date, rc] = versionFile.content.name.split("-V")
|
const [date, rc] = versionFile.content.name.split(".1")
|
||||||
const today = new Date().toLocaleDateString("en-GB")
|
const today = new Date()
|
||||||
|
const month = (today.getMonth() + 1).toString().padStart(2, '0')
|
||||||
|
const day = (today.getDay() + 1).toString().padStart(2, '0')
|
||||||
|
const year = today.getFullYear().slice(-2)
|
||||||
|
const todayFormatted = `${year}/${month}/${day}`
|
||||||
|
|
||||||
let updatedVersionName = undefined
|
let updatedVersionName = undefined
|
||||||
if (today == date) {
|
if (todayFormatted == date) {
|
||||||
updatedVersionName = `${date}-V${parseInt(rc) + 1}`
|
updatedVersionName = `${date}.${parseInt(rc) + 1}`
|
||||||
} else {
|
} else {
|
||||||
updatedVersionName = `${today}-V1`
|
updatedVersionName = `${todayFormatted}.1`
|
||||||
}
|
}
|
||||||
|
|
||||||
const updatedVersionFile = {
|
const updatedVersionFile = {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"code": 28,
|
"code": 28,
|
||||||
"name": "07/11/2022-V1"
|
"name": "22/11/07.1"
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user