Skip to content

Commit

Permalink
fixup! fixup! split concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenet committed Jul 18, 2024
1 parent 811da11 commit 300ca78
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
11 changes: 1 addition & 10 deletions src/exoscale/tools/project/api/git.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
(ns exoscale.tools.project.api.git
(:require [clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.build.api :as b]
(:require [clojure.string :as str]
[clojure.tools.deps.alpha.util.dir :as td]
[exoscale.tools.project.api.version :as v]
[exoscale.tools.project.io :as pio]))
Expand Down Expand Up @@ -33,10 +31,3 @@
:fatal? false})
:out
str/trim-newline))

(defn git-count-revs
[{:as _opts :exoscale.project/keys [version-template-file]
:or {version-template-file "VERSION_TEMPLATE"}}]
(str/replace (slurp (td/canonicalize (io/file version-template-file)))
"GENERATED_VERSION"
(b/git-count-revs nil)))
14 changes: 11 additions & 3 deletions src/exoscale/tools/project/api/version.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
(ns exoscale.tools.project.api.version
(:require [clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.build.api :as b]
[clojure.tools.deps.alpha.util.dir :as td]
[exoscale.deps-version :as version]
[exoscale.tools.project.api.git :as git]))
[exoscale.deps-version :as version]))

(defn get-version
[{:as _opts :exoscale.project/keys [version-file version]}]
Expand All @@ -26,8 +27,15 @@
:suffix version-suffix}))

(defn git-count-revs
[{:as _opts :exoscale.project/keys [version-template-file]
:or {version-template-file "VERSION_TEMPLATE"}}]
(str/replace (slurp (td/canonicalize (io/file version-template-file)))
"GENERATED_VERSION"
(b/git-count-revs nil)))

(defn update-as-git-count-revs
"Updates VERSION file with clojure core libs like version scheme"
[{:as opts :exoscale.project/keys [version-file]
:or {version-file "VERSION"}}]
(spit (td/canonicalize (io/file version-file))
(git/git-count-revs opts)))
(git-count-revs opts)))

0 comments on commit 300ca78

Please sign in to comment.