source ~/.jq file on windows (fixes #3104)
Sourcing of ~/.jq (file) was hardwired to use the HOME environment variable, which is not defined when running in a native Windows shell (PowerShell, CMD). This change lets it check the USERPROFILE environment variable and other standard fallbacks. HOME still has priority if it is set (e.g., in MSYS2 shell).
Possible to add a test for this? we have some $HOME related tests here https://github.com/jqlang/jq/blob/master/tests/shtest#L355 but not sure how messy to emulate a more normal windows env?
Otherwise code change look fine with me and thanks for looking into this!
Ok yeah I did see those tests and briefly puzzled over them running in an msys environment. I will see if I can get at least something simple in there exercising the USERPROFILE case.
Test added (after some minor flopping and twitching).
@kirkoman Could you rebase the changes? The dev manual should be updated.
Forced pushed conflict fix (felt guilty as i was the one who moved the file)
Thanks!
Sorry wasn't tuned in. Thanks for the rebase and the merge!
@kirkoman 🥳