Skip to content

Commit

Permalink
Fix cli -main execution
Browse files Browse the repository at this point in the history
Co-authored-by: @ghrpp <[email protected]>
  • Loading branch information
KGOH and ApricotLace committed Nov 8, 2022
1 parent 214da73 commit 91087df
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ftr/zen_cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(:gen-class)
(:require [zen.cli]
[ftr.zen-package]
[clojure.pprint]
[zen.core]
[zen.store]
[cli-matic.core]))
Expand Down Expand Up @@ -31,7 +32,7 @@


(defn -main
[& args]
[& [cmd-name & args]]
(let [og-read-ns zen.core/read-ns]
(with-redefs
[zen.core/read-ns (fn [ztx zen-ns]
Expand All @@ -40,6 +41,7 @@
zen.core/validate (fn [ztx symbols data]
(-> (ftr.zen-package/validate ztx symbols data)
(select-keys [:errors :warnings :effects])))]
(if (seq args)
(cli-matic.core/run-cmd args cfg)
(zen.cli/repl cfg)))))
(if (some? cmd-name)
(clojure.pprint/pprint (zen.cli/cmd cfg cmd-name args))
(zen.cli/repl cfg))
(System/exit 0))))

0 comments on commit 91087df

Please sign in to comment.