Skip to content

Commit

Permalink
user can now specify not already defined conditions using keyword
Browse files Browse the repository at this point in the history
If conditions are keyword or vector of keywords, condition parser will parse them
as variable if/unless conditions by default even condition parser can't find
them in any of the predefined conditions.
  • Loading branch information
yqrashawn committed Jan 16, 2019
1 parent f2e163a commit a4bb2e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ All notable changes to this project will be documented in this file. This change

** Unreleased

[Unreleased]: https://github.com/yqrashawn/GokuRakuJoudo/compare/v0.1.15...HEAD
[Unreleased]: https://github.com/yqrashawn/GokuRakuJoudo/compare/v0.1.16...HEAD

** 1.16 - 2019-01-16
*** Added
- user can now specify not already defined conditions using keyword

[0.1.16]: https://github.com/yqrashawn/GokuRakuJoudo/compare/v0.1.15...0.1.16

** 1.15 - 2019-01-14
*** Fixed
Expand Down
8 changes: 8 additions & 0 deletions src/karabiner_configurator/conditions.clj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@
:value (second condi)
:type "variable_if"}
result)
;; if we still can't find the right condition, assume
;; user's input is correct and the condition is just not
;; defined yet
result (if (and (nil? result) (keyword? condi))
{:name (name condi)
:value 1
:type condi-type}
result)
validate-result (massert (nn? result)
(str "invalid condition keyword " condi ", can't find in any predefined conditions"))]]
result))))

0 comments on commit a4bb2e5

Please sign in to comment.