This commit is contained in:
Michiel Borkent 2019-12-21 11:48:02 +01:00
parent 2eecdea571
commit 9d29c6f77d
2 changed files with 23 additions and 1 deletions

View file

@ -1 +1 @@
0.0.46-SNAPSHOT
0.0.46

22
script/bump_version.clj Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bb
(ns bump-version
(:require [clojure.java.io :as io]
[clojure.string :as str]))
(def version-file (io/file "resources" "BABASHKA_VERSION"))
(def released-version-file (io/file "resources" "BABASHKA_RELEASED_VERSION"))
(case (first *command-line-args*)
"release" (let [version-string (str/trim (slurp version-file))
[major minor patch] (str/split version-string #"\.")
patch (str/replace patch "-SNAPSHOT" "")]
(spit version-file (str/join "." [major minor patch])))
"post-release" (do
(io/copy version-file released-version-file)
(let [version-string (str/trim (slurp version-file))
[major minor patch] (str/split version-string #"\.")
patch (Integer. patch)
patch (str (inc patch) "-SNAPSHOT")]
(spit version-file (str/join "." [major minor patch]))))
(println "Expected: release | post-release."))