0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-25 08:16:49 -05:00
penpot/common/app/common/version.cljc
2020-12-04 16:11:26 +01:00

18 lines
410 B
Clojure

(ns app.common.version
"A version parsing helper."
(:require
[app.common.data :as d]
[cuerdas.core :as str]))
(defn parse
[version]
(if (= version "%version%")
{:full "develop"
:base "develop"
:build 0
:commit nil}
(let [[base build commit] (str/split version #"-" 3)]
{:full version
:base base
:build (d/parse-integer build)
:commit commit})))