Insert Based on Binary #4196
-
I'm working with my zshenv.tmpl fle and I have a couple lines that I only want to include if nix-env exists. In bash I can use whereis, but how can I check for executables in my tmpl file? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Mostly with You can see a fairly extreme example of how I set this up in |
Beta Was this translation helpful? Give feedback.
-
As @halostatue says,
|
Beta Was this translation helpful? Give feedback.
-
Thank you both so much. I tried searching for binary, file, and a few others in the docs. But I did not think of searching executable, then even when I did, it pulled up the executable functions, but not lookPath which was all I needed. |
Beta Was this translation helpful? Give feedback.
Mostly with
lookPath
. You can usefindExecutable
orfindOneExecutable
to look in values that will be in$PATH
.You can see a fairly extreme example of how I set this up in
.chezmoitemplates/programs.tmpl
.