Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Fix home (~) expand for command paths in config

## 0.106.0

- Change Openai summary from detailed -> auto.
Expand Down
29 changes: 15 additions & 14 deletions src/eca/features/commands.clj
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,21 @@
(->> (get config :commands)
(map
(fn [{:keys [path]}]
(if (fs/absolute? path)
(when (fs/exists? path)
{:name (normalize-command-name path)
:path path
:type :user-config
:content (slurp path)})
(keep (fn [{:keys [uri]}]
(let [f (fs/file (shared/uri->filename uri) path)]
(when (fs/exists? f)
{:name (normalize-command-name f)
:path (str (fs/canonicalize f))
:type :user-config
:content (slurp f)})))
roots))))
(let [path (str (fs/expand-home path))]
(if (fs/absolute? path)
(when (fs/exists? path)
{:name (normalize-command-name path)
:path path
:type :user-config
:content (slurp path)})
(keep (fn [{:keys [uri]}]
(let [f (fs/file (shared/uri->filename uri) path)]
(when (fs/exists? f)
{:name (normalize-command-name f)
:path (str (fs/canonicalize f))
:type :user-config
:content (slurp f)})))
roots)))))
(flatten)
(remove nil?)))

Expand Down
Loading