Skip to content

Commit

Permalink
Fix version bump script
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Jan 3, 2024
1 parent 6929a9c commit 9a35f1e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions script/version_bump.cjs → script/version_bump.js
Original file line number Diff line number Diff line change
@@ -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(".");
Expand All @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit 9a35f1e

Please sign in to comment.