For reasons that are complicated to explain, I have pygmentize installed on my machine but it’s not in the PATH, so I call it using a relative path, like ./bin/pygmentize
Yes, but there should be a completeness to that PR, i.e. all of the external tools should have one, it should be default not set, i.e. fall default to the PATH logic currently in place.
If you’re distributing a “bundle” to different people, you could use a script that calls hugo after modifying the PATH to the location of the binary, i.e.
# Inside hugo.sh
PATH="${BASH_SOURCE%/*}"/bin:$PATH hugo "$@"
"${BASH_SOURCE%/*}"/bin is the subdirectory bin under the folder containing the script
"$@" passes all arguments to the script to hugo, so the person would just call hugo.sh server --buildDrafts and it should work as normal.
(I haven’t actually tested the above, but it should work on systems that use the bash shell)
I verified this. I can tweak the PATH before running a child process. This will allow me to specify where’s pigmentize and such before running Hugo. So my proposed change doesn’t make a lot of sense. Will close the PR.
Thanks everybody for the feedback!