File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 55- Improved flaky test #150
66- Obfuscate env vars in /doctor.
77- Bump clj-otel to 0.2.10
8+ - Add $ARGUMENTS placeholder alias for custom commands.
89
910## 0.66.1
1011
Original file line number Diff line number Diff line change 127127(defn ^:private get-custom-command [command args custom-cmds]
128128 (when-let [raw-content (:content (first (filter #(= command (:name %))
129129 custom-cmds)))]
130- (let [raw-content (string/replace raw-content " $ARGS" (string/join " " args))]
130+ (let [args-joined (string/join " " args)
131+ content-with-args (-> raw-content
132+ (string/replace " $ARGS" args-joined)
133+ (string/replace " $ARGUMENTS" args-joined))]
131134 (reduce (fn [content [i arg]]
132135 (string/replace content (str " $ARG" (inc i)) arg))
133- raw- content
136+ content-with-args
134137 (map-indexed vector args)))))
135138
136139(defn ^:private doctor-msg [db config]
Original file line number Diff line number Diff line change 2525 (testing " multiple occurrences of the same placeholder are all replaced"
2626 (let [custom [{:name " dup" :content " $ARG1-$ARG1 $ARGS" }]]
2727 (is (= " x-x x y"
28- (#'f.commands/get-custom-command " dup" [" x" " y" ] custom))))))
28+ (#'f.commands/get-custom-command " dup" [" x" " y" ] custom)))))
29+
30+ (testing " $ARGUMENTS is supported as alias for $ARGS"
31+ (let [custom [{:name " test" :content " Process $ARGUMENTS here" }]]
32+ (is (= " Process one two here"
33+ (#'f.commands/get-custom-command " test" [" one" " two" ] custom))))))
You can’t perform that action at this time.
0 commit comments