get running as global script working

This commit is contained in:
Travis Shears 2025-06-13 09:56:22 +02:00
parent 589e48304f
commit e2258daafa
3 changed files with 17 additions and 4 deletions

View file

@ -1,2 +1,2 @@
{:backend-host "http://localhost:8080"}
;; {:backend-host "http://aemos:5008"}
;; {:backend-host "http://localhost:8080"}
{:backend-host "http://aemos:5008"}

7
snippets_cms.bb Executable file
View file

@ -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*))

View file

@ -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))))