From b44057963fe75557518be42e7af3a5e63095e368 Mon Sep 17 00:00:00 2001
From: Cam Saul <cammsaul@gmail.com>
Date: Thu, 17 Nov 2016 13:43:57 -0800
Subject: [PATCH] Don't barf if ./bin/version doesn't work during dev

---
 src/metabase/config.clj | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/metabase/config.clj b/src/metabase/config.clj
index 93a8128e63d..084facdf0e2 100644
--- a/src/metabase/config.clj
+++ b/src/metabase/config.clj
@@ -60,8 +60,12 @@
 ;; Metabase version is of the format `GIT-TAG (GIT-SHORT-HASH GIT-BRANCH)`
 
 (defn- version-info-from-shell-script []
-  (let [[tag hash branch date] (-> (shell/sh "./bin/version") :out s/trim (s/split #" "))]
-    {:tag tag, :hash hash, :branch branch, :date date}))
+  (try
+    (let [[tag hash branch date] (-> (shell/sh "./bin/version") :out s/trim (s/split #" "))]
+      {:tag tag, :hash hash, :branch branch, :date date})
+    ;; if ./bin/version fails (e.g., if we are developing on Windows) just return something so the whole thing doesn't barf
+    (catch Throwable _
+      {:tag "?", :hash "?", :branch "?", :date "?"})))
 
 (defn- version-info-from-properties-file []
   (when-let [props-file (io/resource "version.properties")]
-- 
GitLab