Created
February 27, 2017 21:42
-
-
Save devstopfix/92949751d34f950c80f2fe9b82307732 to your computer and use it in GitHub Desktop.
Generate a non-semantic version number [1 year day-of-year]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/planck -cp | |
(ns accrete | |
(:require [cljs-time.core :as t] | |
[cljs-time.format :as f] | |
[clojure.string :refer [join]])) | |
(def this-year (-> (t/now) (t/year))) | |
(defn day-of-year [] | |
(->> (t/now) (t/interval (t/date-time this-year)) (t/in-days) (inc))) | |
(defn ver [] | |
(->> [1 (mod this-year 100) (day-of-year)] | |
(join "."))) | |
; planck -c ./accrete.cjs:`find ~/.m2 -name cljs-time*jar` -m accrete | |
(defn -main [name] | |
(print (ver))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment