mvdan / sh

A shell parser, formatter, and interpreter with bash support; includes shfmt
https://pkg.go.dev/mvdan.cc/sh/v3
BSD 3-Clause "New" or "Revised" License
7.29k stars 345 forks source link

interp: source script from PATH #742

Closed cclerget closed 3 years ago

cclerget commented 3 years ago

The shell behavior regarding script sourcing is to look first into PATH when the filename doesn't contain any path separator then look for the script in the current working directory. If the filename contain a path separator, then the script is sourced from the current working directory.

mvdan commented 3 years ago

I hadn't noticed https://github.com/hpcng/singularity/pull/5028 all the way back last year :) It's good to hear it's running well, minus some bugs like this one.

Happy to receive issues if you have ideas to improve your use case, by the way. Of course more than happy to review patches for bugfixes too.

cclerget commented 3 years ago

Thanks ! Yes it runs really well, so far sourcing conda environments is the fireproof for your package ;)

mvdan commented 3 years ago

Thanks! Appreciate the quality patch.