-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run_first_once script not running before template evaluation #2315
Comments
Thanks for the kind words :) The script is failing because the 1Password CLI ( $ which op |
Note that chezmoi can't find
|
Thanks for the quick support! Yes that's the issue, the script is actually not run yet, but the template is already evaluated. The command This is related to #664, my understanding would be that we can have initialization scripts that install dependencies (like a password manager) before anything else happens. |
You can make the script run first by prepending characters ( If you are installing a dependency, you can also add the |
Thank you so much @bradenhilton ! I'd totally missed the #2316 adds a test for the issue reported here, verifying that it works. |
Thanks! |
Good idea, done in 097a88c. |
Describe the bug
First of all thanks for creating chezmoi, it's really amazing and my favorite dotfile manager! 🙌
I'm trying to set up my machine with chezmoi, which includes templated files that read secrets from 1Password.
Given the following setup, it does not run the script first but immediately tries to evaluate the template, which fails:
To reproduce
Repository:
Running chezmoi apply fails with:
chezmoi: template: dot_aws/executable_credentials.tmpl:2:21: executing "dot_aws/executable_credentials.tmpl" at <onepasswordRead "op://XXX/XXXX/XXXX">: error calling onepasswordRead: op signin --raw: exec: "op": executable file not found in $PATH
Expected behavior
The script should run first, even before any template is read or evaluated.
Output of command with the
--verbose
flagOutput of
chezmoi doctor
The text was updated successfully, but these errors were encountered: