A command-line script runs fine when I execute it from the project folder but fails to find its configuration file when launched elsewhere. The path is relative to the current working directory, not necessarily where the script lives. I can fix it with an absolute path, but would prefer portability. What's the clean pattern for resolving bundled files relative to the script while still allowing a user to specify an external config path?
Figuring out why a command-line tool works from one folder but not another
- programming-help
- figuring
- command
- line
90