Closed balaji-dutt closed 1 year ago
What is the output of:
$ chezmoi execute-template < .chezmoiscripts/run_once_before_emacs_spellcheck.sh.tmpl > a.sh
$ chmod a.sh
$ ./a.sh
If this gives the same "file not found" error then it is likely that /bin/sh
is missing in your installation.
$ ./a.sh
bash: ./a.sh: /bin/sh^M: bad interpreter: No such file or directory
Gah! Mixed line-ending woes. Not entirely sure why VSCode decided to switch the line-endings in the file to CRLF
but switching back to LF
fixed it.
Thank you for the helpful suggestion and for sharing a different way to debug templates!
What exactly are you trying to do?
I'm trying to debug an extremely strange issue where a previously working
.chezmoiscripts
template file is now abruptly generating afork/exec /tmp/3067120083.XXXX.sh: no such file or directory
error.What have you tried so far?
I am creating a simple script template with the following lines:
.chezmoiscripts/run_once_before_emacs_spellcheck.sh.tmpl
:However, when I try to run
chezmoi apply
it fails with thefork/exec
error.Where else have you checked for solutions?
Output of any commands you've tried with
--verbose
flagOutput of
chezmoi doctor
Additional context
chezmoi execute-template
does not throw any error with this file:Running
chezmoi state delete --bucket=entryState --key="/home/balaji/.chezmoiscripts/emacs_spellcheck.sh"
and thenchezmoi apply
did not make any change.This is the original complete script that was working two days ago.