mtkennerly / shawl

Windows service wrapper for arbitrary commands
MIT License
520 stars 15 forks source link

Option to set environment and PATH #17

Closed ahirner closed 2 years ago

ahirner commented 3 years ago

We set some local configuration with ENVs, e.g. secrets. Furthermore, our exes needs to reach some special DLLs, hence the need to prepend to PATH.

As inspiration, Apache's Procrun Daemon recognises --LibraryPath to prepend to PATH and ++Environment to set ENVs. It's used e.g. by tomcat.

Example for ENVs on the basis of this structopt example:

shawl run --env FOO=C:\bar\baz --env PORT=8888 -- <my_bin>

Example for paths with value_delimiter(";"):

shawl run --paths C:\abc;C:\xyz -- <my_bin>

Would it be meaningful to introduce one or both options in shawl or you'd propose a config wrapper for such cases?

mtkennerly commented 3 years ago

Thanks for this idea! Part of me wants to say that a wrapper script should be enough, but I think this is a common enough use case that it's probably worth adding.