Closed sohmc closed 1 year ago
Is it possible that this is caused by the newline that precedes the shebang?
What are the contents of the template?
Also, unsure of the specific reason, but it appears you aren't running the latest version of chezmoi.
Is it possible that this is caused by the newline that precedes the shebang?
This is definitely the reason.
Yup, that was it. I added a -
to the end curly brace in if statement and it "works"
Technically getting a different error but this one seems bash related. Thanks for the quick assist.
Looking at your crontab entry, you're using ~
to represent your home directory. The expansion of ~
is typically done by the shell and is not available in other places (e.g. it's not normally available in crontabs). It's safer to use the environment variable $HOME
instead.
@twpayne coming in with an unrelated assist. Thank you! didn't know that. It's always worked for me.
Describe the bug
I am attempting to create a script that will install a cronjob for chezmoi. The script is templated so that if it detects linux, then the bash script will output.
When I do
chezmoi -v apply
, I get the following error:To reproduce
Expected behavior
I expect the script to run without issue.
Output of command with the
--verbose
flagOutput of
chezmoi doctor
Additional context
My end state is to have chezmoi install a crontab on machines where it is installed to apply chezmoi automatically once an hour. If there is a better way for this, I'm happy to do that instead.
There is a previous issue #666 that has the same error. But in my case, I don't have an existing runfile, besides the one I'm templating.