-
When I try to run functions I created in my .zshrc I see an "executable file not found in $PATH" message. How can i call those custom functions from Taskfile? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Task does not use your local shell to run commands (It uses You have a couple of options to make this work. The simplest is probably to invoke your shell (the one your functions are defined in). You can do this by running your command like this: tasks:
default:
cmds:
- zsh -c "my_custom_function" # <--- replace 'zsh` with your shell However, this isn't very portable. If you're writing a project that will be used by other users on different machines, then you might want to include the custom function as a script inside your project and invoke it directly: tasks:
default:
cmds:
- ./scripts/my_custom_script.zsh |
Beta Was this translation helpful? Give feedback.
-
Thank you very much, i can use that. since I use this only for myself |
Beta Was this translation helpful? Give feedback.
Task does not use your local shell to run commands (It uses
gosh
from mvdan/sh), so your.profile
,.bashrc
,.zshrc
etc files are not being read. This means that your$PATH
is not being set and your custom functions are not available.You have a couple of options to make this work. The simplest is probably to invoke your shell (the one your functions are defined in). You can do this by running your command like this:
However, this isn't very portable. If you're writing a project that will be used by other users on different machines, then you might want to include the custom function as a s…