Skip to content

Commit

Permalink
service: refactor template-edn function to aid diagnosis
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalli-johnny committed Apr 8, 2024
1 parent 15d4355 commit 7b91792
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. This change
- dev: repository trivy ignore CVE-2024-22871
- service: move mulog publisher inside donut system config
- readme: simplify readme, add overview, remove older examples
- service: refactor template-edn function to aid diagnosis

# 2024-01-23
## Changed
Expand Down
19 changes: 11 additions & 8 deletions src/practicalli/service.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
[clojure.pprint :as pprint]
[practicalli.rules :as rules]))


#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn substitutions
"Update keys & values available in the substitution data,
Expand All @@ -26,10 +25,10 @@
;; Simple example:
#_(when (= (data :component) "integrant")
{:integrant-repl true})

;; (println "Calculating substitutions...")
;; (pprint/pprint data)
nil) ; returning nil means no changes to options data


#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn template-edn
"Update data in the template.edn configuration.
Expand All @@ -40,13 +39,17 @@
- new template.edn configuration"
[edn data]

;; (pprint/pprint data)
;; Link to Practicalli Clojure Project Templates guide
(println "Template guide: https://practical.li/clojure/clojure-cli/projects/templates/")

;; (println "Component" (data :component))
(let [updated-template
(cond
(= :donut (data :component)) (assoc edn :transform rules/donut)
(= :integrant (data :component)) (assoc edn :transform rules/integrant)
:else edn)]

;; (println "Updated template...")
;; (pprint/pprint updated-template)
updated-template))

(cond
(= :donut (data :component)) (assoc edn :transform rules/donut)
(= :integrant (data :component)) (assoc edn :transform rules/integrant)
:else edn))

0 comments on commit 7b91792

Please sign in to comment.