From e15806888adb607ad076557f62b3f89dddf011e5 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Sat, 7 Jan 2023 16:38:40 +0000 Subject: [PATCH] Updating version name format to use chronological and numerical ordering --- tools/beta-release/app.js | 14 +++++++++----- version.json | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/beta-release/app.js b/tools/beta-release/app.js index 9ee62da..a1b57b0 100644 --- a/tools/beta-release/app.js +++ b/tools/beta-release/app.js @@ -135,14 +135,18 @@ const createBranch = async (github, branchName, fromBranch) => { const incrementVersionFile = async (github, branchName) => { const versionFile = await readVersionFile(github, branchName) - const [date, rc] = versionFile.content.name.split("-V") - const today = new Date().toLocaleDateString("en-GB") + const [date, rc] = versionFile.content.name.split(".1") + 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 - if (today == date) { - updatedVersionName = `${date}-V${parseInt(rc) + 1}` + if (todayFormatted == date) { + updatedVersionName = `${date}.${parseInt(rc) + 1}` } else { - updatedVersionName = `${today}-V1` + updatedVersionName = `${todayFormatted}.1` } const updatedVersionFile = { diff --git a/version.json b/version.json index 5d6abcc..c2fbb09 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { "code": 28, - "name": "07/11/2022-V1" + "name": "22/11/07.1" } \ No newline at end of file