diff --git a/config.edn b/config.edn index 90e2cc7..fd98ff5 100644 --- a/config.edn +++ b/config.edn @@ -1,2 +1,2 @@ -{:backend-host "http://localhost:8080"} -;; {:backend-host "http://aemos:5008"} +;; {:backend-host "http://localhost:8080"} +{:backend-host "http://aemos:5008"} diff --git a/snippets_cms.bb b/snippets_cms.bb new file mode 100755 index 0000000..50c10fa --- /dev/null +++ b/snippets_cms.bb @@ -0,0 +1,7 @@ +#!/usr/bin/env bb + +(ns snippets-cms + (:require [cli-cms.main])) + +(when (= *file* (System/getProperty "babashka.file")) + (apply cli-cms.main/-main *command-line-args*)) diff --git a/src/cli_cms/config.clj b/src/cli_cms/config.clj index 1238180..becc534 100644 --- a/src/cli_cms/config.clj +++ b/src/cli_cms/config.clj @@ -1,3 +1,9 @@ -(ns cli-cms.config) +(ns cli-cms.config + (:require + [babashka.fs :as fs] + [clojure.string :as str])) -(def config (read-string (slurp "config.edn"))) +(def config + (let [project-root (str/join "/" (drop-last 3 (fs/components *file*))) + config-file-path (format "/%s/config.edn" project-root)] + (read-string (slurp config-file-path))))