Skip to content
Snippets Groups Projects
Commit 29c3ee77 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge branch 'master' into new_filters

parents 4c1cf761 2247337e
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,7 @@
:short (-> (shell/sh "./version" "--short") :out s/trim)})
(defn- version-info-from-properties-file []
(with-open [reader (io/reader "resources/version.properties")]
(with-open [reader (io/reader (io/resource "version.properties"))]
(let [props (java.util.Properties.)]
(.load props reader)
(into {} (for [[k v] props]
......
;; -*- comment-column: 35; -*-
(ns metabase.core
(:gen-class)
(:require [clojure.string :as s]
(:require [clojure.java.io :as io]
[clojure.string :as s]
[clojure.tools.logging :as log]
[colorize.core :as color]
[ring.adapter.jetty :as ring-jetty]
......@@ -160,11 +161,9 @@
(when-not (sample-dataset-id)
(try
(log/info "Loading sample dataset...")
(let [resource (-> (Thread/currentThread) ; hunt down the sample dataset DB file inside the current JAR
.getContextClassLoader
(.getResource sample-dataset-filename))]
(let [resource (io/resource sample-dataset-filename)]
(if-not resource
(log/error (format "Can't load sample dataset: the DB file '%s' can't be found by the ClassLoader." sample-dataset-filename))
(log/error (format "Can't load sample dataset: the DB file '%s' can't be found." sample-dataset-filename))
(let [h2-file (-> (.getPath resource)
(s/replace #"^file:" "zip:") ; to connect to an H2 DB inside a JAR just replace file: with zip:
(s/replace #"\.mv\.db$" "") ; strip the .mv.db suffix from the path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment