Add release command (#2022)

add release command
remove unescessary yarn.lock
This commit is contained in:
brendanlaschke
2023-10-14 23:04:35 +02:00
committed by GitHub
parent 160b7039d9
commit 3c9cd9ff4a
4 changed files with 50 additions and 4 deletions

View File

@ -1,4 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

23
infra/release/release.js Normal file
View File

@ -0,0 +1,23 @@
const fs = require("fs");
const semver = require("semver");
const path = require("path");
// Get the version argument from the command line
const [, , version] = process.argv;
if (!semver.valid(version)) {
console.error(
"Invalid version. The format should be X.X.X where X is a positive integer (or 0)."
);
process.exit(1);
}
const FrontPackageJson = path.join(__dirname, "../../front/package.json");
const ServerPackageJson = path.join(__dirname, "../../server/package.json");
// Update package.json
for (let file of [FrontPackageJson, ServerPackageJson]) {
let pkgdata = JSON.parse(fs.readFileSync(file));
pkgdata.version = version;
fs.writeFileSync(file, JSON.stringify(pkgdata, null, 2), "utf8");
}