Fix version bump script (#19264)

This commit is contained in:
Bram Kragten 2024-01-03 15:19:30 +01:00 committed by GitHub
parent 6929a9c603
commit 7a6fc573c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -1,7 +1,10 @@
#!/usr/bin/env node
const fs = require("fs");
const util = require("util");
const exec = util.promisify(require("child_process").exec);
/* eslint-disable no-console */
import fs from "fs";
import util from "util";
import child_process from "child_process";
const exec = util.promisify(child_process.exec);
function patch(version) {
const parts = version.split(".");
@ -18,7 +21,7 @@ function today() {
function auto(version) {
const todayVersion = today();
if (todayVersion !== version) {
if (todayVersion.split(".")[0] !== version.split(".")[0]) {
return todayVersion;
}
return patch(version);
@ -44,7 +47,7 @@ async function main(args) {
commit = true;
} else {
method = args.length > 0 && methods[args[0]];
commit = args.length > 1 && args[1] == "--commit";
commit = args.length > 1 && args[1] === "--commit";
}
if (!method) {