Skip to content

Commit

Permalink
fix: #164 expand home for GOKU_EDN_CONFIG_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
yqrashawn committed Jul 12, 2022
1 parent 446d6c7 commit 2295ee4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ All notable changes to this project will be documented in this file. This change

** Unreleased

[Unreleased Commits]: https://github.com/yqrashawn/GokuRakuJoudo/compare/v0.5.4...HEAD
[Unreleased Commits]: https://github.com/yqrashawn/GokuRakuJoudo/compare/v0.5.5...HEAD

** 0.5.5 - 2022-07-12
*** Fixed
- fix https://github.com/yqrashawn/GokuRakuJoudo/issues/164

[commits in 0.5.5]: https://github.com/yqrashawn/GokuRakuJoudo/compare/v0.5.4...v0.5.5

** 0.5.4 - 2022-07-12
*** Changed
- use ~/bin/zsh~ instead of ~/bin/sh~ in launch agent https://github.com/yqrashawn/homebrew-goku/blob/9a4f6cd23f51535e046a33fe260876630fc20292/Formula/goku.rb#L28
Expand Down
11 changes: 5 additions & 6 deletions src/karabiner_configurator/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
[]
(cond
(System/getenv "GOKU_EDN_CONFIG_FILE")
(System/getenv "GOKU_EDN_CONFIG_FILE")
(fs/expand-home (System/getenv "GOKU_EDN_CONFIG_FILE"))
(System/getenv "XDG_CONFIG_HOME")
(str (System/getenv "XDG_CONFIG_HOME") "/karabiner.edn")
(fs/expand-home (str (System/getenv "XDG_CONFIG_HOME") "/karabiner.edn"))
:else
(str (System/getenv "HOME") "/.config/karabiner.edn")))

Expand Down Expand Up @@ -171,9 +171,7 @@
(string/join \newline errors)))

(defn abs-path [path]
(if (= (first path) \~)
(.getPath (fs/expand-home path))
path))
(.getPath (fs/expand-home path)))

(def cli-opts
[["-h" "--help"]
Expand All @@ -185,7 +183,8 @@
(let [path (abs-path path)]
(and (fs/exists? path)
(fs/file? path)
(fs/readable? path)))) "Make sure the file is exits and readable"]]
(fs/readable? path))))
"Make sure the file is exits and readable"]]
["-d" "--dry-run"]
["-A" "--dry-run-all"]])

Expand Down

0 comments on commit 2295ee4

Please sign in to comment.