prompt functions should not only be init functions #4890
Replies: 1 comment 1 reply
-
The frequent prompting is unique to Bitwarden (and perhaps a few other managers), as some allow for temporary sessions which reduces the frequency of prompting. It's not a given that secret manager = prompting every time.
Does |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's my use case.
dot_gitconfig. I remove the hard-coded email address, and replace it with a template roughly resembling{{- $git_email := promptString "Git email" -}}{{- .git_email -}}.chezmoi applyet al prompt me for the email I'd like to use.But alas, this doesn't work. All the prompt functions are init functions, which means they only exist for
chezmoi init.I don't understand this design decision. A comment from the author in an old discussion says this was done so that the user isn't constantly asked to answer prompts just for commands like
chezmoi status.But it appears that the password manager integration does exactly that; in my experiments with the Bitwarden CLI, chezmoi was constantly fetching values from Bitwarden for just about every little operation. Why the inconsistency?
And beyond that: How am I supposed to solve the workflow problem laid out above? Do I just completely lose access to the prompt functions once I have set chezmoi up on a given machine? What if I want to safely "re-init" a given machine without having to temporarily screw up my dotfiles; is there no way to trigger a re-prompt?
Beta Was this translation helpful? Give feedback.
All reactions