mirror of
https://github.com/Budibase/budibase.git
synced 2026-09-01 15:11:45 +08:00
18 lines
542 B
JavaScript
18 lines
542 B
JavaScript
const fs = require("fs")
|
|
const semver = require("semver")
|
|
|
|
const filePath = "../hosting/couchdb/VERSION"
|
|
const versionBump = process.argv[2] || "minor"
|
|
|
|
if (!["minor", "major"].includes(versionBump)) {
|
|
console.error("Usage: node bumpDatabaseVersion.js [minor|major]")
|
|
process.exit(1)
|
|
}
|
|
|
|
const currentVersion = fs.readFileSync(filePath, "utf8").trim()
|
|
const newVersion = semver.inc(currentVersion, versionBump)
|
|
|
|
fs.writeFileSync(filePath, newVersion + "\n")
|
|
|
|
console.log(`Updated database version from ${currentVersion} to ${newVersion}`)
|