Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Download fixtures
(ns leiningen.company-fixtures
(:require [leiningen.core.project :as project]
[me.raynes.fs :as fs]
[me.raynes.fs.compression :as compress]
[clojure.java.io :as io]))
(def ^:const url
"http://example-company.com/url.zip")
(defn- expand-path [path]
(str (fs/normalized-path path)))
(def fixture-path
(expand-path (io/file "./test/fixtures" (fs/base-name url))))
(defn- unzip [path]
(compress/unzip path))
(defn- download [from to]
(io/copy (io/input-stream from) (io/output-stream to)))
(defn- download-if-missing [from to]
(if-not (fs/exists? to) (download from to)))
(defn company-fixtures [_]
(download-if-missing url fixture-path)
(unzip fixture-path))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.