Skip to content

Commit

Permalink
Update to dev/setup.clj to work on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjkidd authored and tobias committed Mar 7, 2016
1 parent 66a0097 commit a0d7c0a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/clojars/dev/setup.clj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
(doto (-> .getVersioning (.addVersion version)))
(write-metadata md-file))))

; TODO: If there are more places that require this, move to a utility location.
(defn get-path
"Ensures that / is used as separator when regex depends on it."
[file]
(str/replace (.getPath file) (java.io.File/separator) "/"))

(defn import-repo
"Builds a dev db from the contents of the repo."
[db repo stats-dir users]
Expand All @@ -70,7 +76,7 @@
:when (and (.isDirectory version-dir)
(re-find #"^[0-9]\." (.getName version-dir)))
:let [parent (.getParentFile version-dir)
[_ group-path artifact-id] (re-find group-artifact-pattern (.getPath parent))
[_ group-path artifact-id] (re-find group-artifact-pattern (get-path parent))
version (.getName version-dir)
group-id (str/lower-case (str/replace group-path "/" "."))
user (or (first (db/group-membernames db group-id)) (rand-nth users))]]
Expand Down

0 comments on commit a0d7c0a

Please sign in to comment.