From 4e43bf5f787b4507e91c0025ecabd942379ed1fa Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 19 Jan 2021 16:28:53 +0100 Subject: [PATCH] :sparkles: Improve version parsing. --- common/app/common/version.cljc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/common/app/common/version.cljc b/common/app/common/version.cljc index a2508d6852..9257d95877 100644 --- a/common/app/common/version.cljc +++ b/common/app/common/version.cljc @@ -23,10 +23,18 @@ :commit nil} (string? version) - (let [[base build commit] (str/split version #"-" 3)] - {:full version - :base base - :build (d/parse-integer build) - :commit commit}) + (if (re-seq #"^[A-Za-z]+\-" version) + (let [[branch base build commit] (str/split version #"-" 4)] + {:full version + :base base + :build (d/parse-integer build) + :branch branch + :commit commit}) + (let [[base build commit] (str/split version #"-" 3)] + {:full version + :base base + :build (d/parse-integer build) + :branch nil + :commit commit})) :else nil))