Include libexec directory for script when run

Hi everyone!

This is my first post, so bear with me.

I have this script, vpm, which make use of the libexec directory for commands intended to be run by the bin/vpm binary. I want to add the libexec directory to $PATH when running the vpm binary. I don't want the script itself to try figure out where the path is, so I want to specify the path during installation.

Currently the binary have this line export PATH="%VPM_LIBEXECDIR%:$PATH" . When I install the script I just replace "%VPM_LIBEXECDIR%" with the actual path.

This works, but it's problematic when I develop locally because then I just want to run the script directly by going to the directory and run ./bin/vpm .

How does people usually solve this problem?

You can run your script like this:

PATH=/your/libexec/path:$PATH ./bin/vpm

But of course, why didn't I think of that! Thank you. I guess the only thing that will be bugging me a bit is the fact that the string "%VPM_LIBEXECPATH%" is present in $PATH, which is kind of ugly. Then, again, this will only occur when running it directly (no installation).