 (ns frontend.utils.vcs-url
-  (:require [clojure.string :as string]))
+  (:require [clojure.string :as string]
+            [frontend.utils :as utils :include-macros true]))
 
 (def url-project-re #"^https?://([^/]+)/(.*)")
 

  (.replace (project-name vcs-url) "/" \u200b))

(defn project-path [vcs-url]
  (str "/gh/" (project-name vcs-url)))


(defn vcs-type [vcs-url]
  (or ({"github.com" "github"
        "bitbucket.org" "bitbucket"} (second (re-matches url-project-re vcs-url)))
      "github"))

;; slashes aren't allowed in github org/user names or project names
