mirror of
https://github.com/SwingTheVine/Wplace-BlueMarble.git
synced 2026-03-11 17:15:38 +00:00
Changed how build versioning works
This commit is contained in:
parent
0e87db27e8
commit
bad61cf713
1 changed files with 4 additions and 2 deletions
|
|
@ -16,8 +16,10 @@ console.log(`${consoleStyle.GREEN}Read version from manifest.json.${consoleStyle
|
|||
|
||||
// Update the version number
|
||||
const versionNums = manifest.version.split('.'); // Split the version numbers into individual strings
|
||||
versionNums[versionNums.length-1] = Number(versionNums[versionNums.length-1])+1; // Add one to the last version number position
|
||||
manifest.version = versionNums.join('.'); // Combine the version numbers back int a whoel string
|
||||
const lastSegment = versionNums[versionNums.length-1].split("-"); // Other than numbers, the version can optionally end with a hyphen and identifier
|
||||
lastSegment[0] = Number(lastSegment[0])+1; // Add one to the last version number position
|
||||
versionNums[versionNums.length-1] = lastSegment.join("-") // Join the last number and identifier back into one string
|
||||
manifest.version = versionNums.join('.'); // Combine the version numbers back into a whole string
|
||||
|
||||
fs.writeFileSync('dist/manifest.json', JSON.stringify(manifest));
|
||||
console.log(`${consoleStyle.GREEN}Updated userscript version.${consoleStyle.RESET} Version: ${consoleStyle.MAGENTA}${manifest.version}${consoleStyle.RESET}`);
|
||||
Loading…
Reference in a new issue