Skip to content

executable file not found in $PATH #1016

Answered by pd93
Drallas asked this question in Q&A
Discussion options

You must be logged in to vote

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:

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 s…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Drallas
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants