Mac: hermes settings, set terminal.cwd to "." instead of unsetting
Non-interactively, `hermes config get` prints only the default for a key that isn't in config.yaml, so an unset key can't be detected and the play kept trying (and failing) to unset terminal.cwd. Set it to Hermes's own default "." instead and drop the unset branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3f4ed3efcb
commit
4bdb89885c
3 files changed
+12
-15
No files matched your search
@@ -1,6 +1,8 @@
|
||||
# `hermes config get` prints the value as YAML, so
|
||||
# it's compared structurally; `hermes config set` takes JSON for lists and
|
||||
# booleans. A null value means the key should not be set at all.
|
||||
# `hermes config get` prints the value as YAML, so it's compared
|
||||
# structurally; `hermes config set` takes JSON for lists and booleans.
|
||||
# Settings are always set explicitly: for a key that isn't in config.yaml,
|
||||
# `config get` (non-interactive) prints just the default, so "unset" can't be
|
||||
# detected.
|
||||
- name: Read Hermes settings
|
||||
ansible.builtin.command:
|
||||
argv: ["{{ hermes_cli }}", config, get, "{{ item.key }}"]
|
||||
@@ -12,15 +14,11 @@
|
||||
- name: Set Hermes settings
|
||||
ansible.builtin.command:
|
||||
argv: >-
|
||||
{{ [hermes_cli, 'config', 'unset', item.item.key] if item.item.value is none else
|
||||
[hermes_cli, 'config', 'set', item.item.key,
|
||||
{{ [hermes_cli, 'config', 'set', item.item.key,
|
||||
item.item.value if item.item.value is string else item.item.value | to_json] }}
|
||||
loop: "{{ hermes_settings_current.results }}"
|
||||
loop_control:
|
||||
label: "{{ item.item.key }} = {{ item.item.value | to_json }}"
|
||||
# "Config key not set" goes to stderr, with Hermes's default on stdout.
|
||||
when: >-
|
||||
(none if item.stderr is search('Config key not set') else item.stdout | from_yaml)
|
||||
!= item.item.value
|
||||
when: (item.stdout | from_yaml) != item.item.value
|
||||
# The dashboard is a separate process with its own copy of the settings.
|
||||
notify: [Restart Hermes gateway, Restart Hermes dashboard]
|
||||
Reference in new issue
Block a user