|
|
@@ -2,8 +2,7 @@
|
|
|
(:require [clojure.set :as set]
|
|
|
[clojure.string :as string]
|
|
|
[frontend.state :as state]
|
|
|
- [frontend.util :as util]
|
|
|
- [frontend.env :as env]))
|
|
|
+ [frontend.util :as util]))
|
|
|
|
|
|
(goog-define DEV-RELEASE false)
|
|
|
(defonce dev-release? DEV-RELEASE)
|
|
|
@@ -14,33 +13,28 @@
|
|
|
|
|
|
;; :TODO: How to do this?
|
|
|
;; (defonce desktop? ^boolean goog.DESKTOP)
|
|
|
-(def test? (= :test (env/get-static :runtime)))
|
|
|
-(def staging? (= :staging (env/get-static :runtime)))
|
|
|
-(def prod? (= :prod (env/get-static :runtime)))
|
|
|
|
|
|
(def app-name "logseq")
|
|
|
+(def website
|
|
|
+ (if dev?
|
|
|
+ "http://localhost:3000"
|
|
|
+ (util/format "https://%s.com" app-name)))
|
|
|
|
|
|
-
|
|
|
-(def website (env/get-static :website))
|
|
|
-(def api (env/get-static :api))
|
|
|
-(def asset-domain (env/get-static :asset-domain))
|
|
|
-(def github-app-name (env/get-static :github-app-name))
|
|
|
+(def api
|
|
|
+ (if dev?
|
|
|
+ "http://localhost:3000/api/v1/"
|
|
|
+ (str website "/api/v1/")))
|
|
|
|
|
|
(defn asset-uri
|
|
|
[path]
|
|
|
- (cond
|
|
|
- (util/file-protocol?)
|
|
|
+ (if (util/file-protocol?)
|
|
|
(string/replace path "/static/" "./")
|
|
|
+ (if dev? path
|
|
|
+ (str asset-domain path))))
|
|
|
|
|
|
- dev? path
|
|
|
-
|
|
|
- staging?
|
|
|
- (if-let [branch (-> (state/get-me) :git-branch)]
|
|
|
- (str asset-domain "/" branch path)
|
|
|
- (str asset-domain path))
|
|
|
+(goog-define GITHUB_APP_NAME "logseq-test")
|
|
|
|
|
|
- :else
|
|
|
- (str asset-domain path)))
|
|
|
+(def github-app-name (if dev? GITHUB_APP_NAME "logseq"))
|
|
|
|
|
|
(defn git-pull-secs
|
|
|
[]
|