feat(git): add release workflow
This commit is contained in:
16
version.cjs
Normal file
16
version.cjs
Normal file
@@ -0,0 +1,16 @@
|
||||
const { readFileSync, writeFileSync } = require("node:fs");
|
||||
const { join, resolve } = require("node:path");
|
||||
|
||||
const ROOT_DIR = resolve(__dirname);
|
||||
const VERSION = process.argv[process.argv.indexOf("--version") + 1];
|
||||
|
||||
setPackageVersions(ROOT_DIR, VERSION);
|
||||
|
||||
function setPackageVersions(rootDir, version) {
|
||||
const packagePath = join(rootDir, "package.json");
|
||||
const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
|
||||
|
||||
packageJson.version = version;
|
||||
|
||||
writeFileSync(packagePath, JSON.stringify(packageJson, null, 2));
|
||||
}
|
||||
Reference in New Issue
Block a user