-
Notifications
You must be signed in to change notification settings - Fork 501
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
Cannot apply my dotfiles on Termux #4268
Comments
Is |
dynconfig is correctly defined in .chezmoidata:
Executing any template at this moment is difficult, as all of my templates depend on the _dynamic/dyn_config.json being present. That's why the But the template to generate the shell script which is run to generate the dyn_config.json can be executed. In fact it has been executed, as the x_trace shows. But here goes my manual template execution anyway:
|
To address your other question: I saved the script generated from the template in a tempfile.sh and executed it manually. It works. The tempfile.sh is populated with the correct values, it runs the python command which writes the file
I believe the mechanics of my dynamic configuration generation procedure in the run_before script to be sound and not really the cause of the error here. I have successfully deployed and applied these dotfiles on my FreeBSD desktop, on Raspberry Pi, on my Debian Linux work laptop, but it cannot be done in Termux on my mobile phone. Unless I fake the Linux FHS. |
On my FreeBSD machine the
|
|
@twpayne is that already addressed by this in the initial post?
|
I don't think so. I suspect that the problem is that Termux doesn't have |
Ah, I see now. I was aware of this issue but I thought something might have changed as I haven't done anything with Termux for a while. The shebang works: $ cat hello.sh
#!/usr/bin/env sh
echo "hello"
$ ./hello.sh
hello But it doesn't work when used in a $ mv hello.sh .local/share/chezmoi/run_hello.sh
$ chezmoi apply
chezmoi: hello.sh: fork/exec /data/data/com.termux/files/usr/tmp/1663789932.hello.sh: no such file or directory $ mv .local/share/chezmoi/run_hello.sh .local/share/chezmoi/run_hello.sh.tmpl
$ sed -i '1s|^#!/usr/bin/env sh|#!{{ lookPath "sh" }}|' .local/share/chezmoi/run_hello.sh.tmpl
$ chezmoi apply
hello |
|
Thank you very much. The lookPath solution works perfectly. |
What exactly are you trying to do?
Using Termux in Android. I have cloned my dotfiles in ~/.local/share/chezmoi. I have run
chezmoi init
. When I runchezmoi --debug --verbose apply
, I get this error:Chezmoi doctor says:
What have you tried so far?
I have tried to run
termux-chroot
which makes Termux behave as if it had classical Linux File Hierarchy System (FHS) (i.e. /bin, /usr, /tmp, /etc, ...). See here. This is useful for programs which require the classical Linux directories. This helps. With the Linux FHS I can apply my dotfiles, but in my case this later causes interoperability problems with other Termux software I use.I was suspicious that the problem might be in the shebang of my script. So I created a test script with the same shebang (
#!/usr/bin/env sh
). It turns out the shebang is not the problem. Newer versions of Termux handle shebangs like this all right.Then I was thinking that it does not find python, but this also is ok, python is available and found
Where else have you checked for solutions?
The text was updated successfully, but these errors were encountered: