Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure CLI by

I have this clojure code in my tools/build.clj file:

(ns build
  (:require [clojure.tools.build.api :as build]))
;; Get the number of commits reachable since the last tagged commit.
(def version
  (let [last-tag (build/git-process {:git-args "describe --tags --abbrev=0"})]
    (format "%s.%s"
            last-tag
            (build/git-process {:git-args
                                ["rev-list"
                                 (format "%s..HEAD"
                                         last-tag)
                                 "--count"]}))))

This sets the version string to null.null when run on Windows, but not when run on Linux. Thought you'd want to know.

1 Answer

0 votes
by

You probably need to set the :git-command attribute when building on Windows to whatever your git command is.

https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-git-process

...