jq icon indicating copy to clipboard operation
jq copied to clipboard

source ~/.jq file on windows (fixes #3104)

Open kirkoman opened this issue 1 year ago • 3 comments

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).

kirkoman avatar May 07 '24 21:05 kirkoman

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!

wader avatar May 08 '24 07:05 wader

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.

kirkoman avatar May 08 '24 15:05 kirkoman

Test added (after some minor flopping and twitching).

kirkoman avatar May 09 '24 21:05 kirkoman

@kirkoman Could you rebase the changes? The dev manual should be updated.

itchyny avatar Aug 20 '24 12:08 itchyny

Forced pushed conflict fix (felt guilty as i was the one who moved the file)

wader avatar Aug 23 '24 10:08 wader

Thanks!

itchyny avatar Aug 23 '24 23:08 itchyny

Sorry wasn't tuned in. Thanks for the rebase and the merge!

kirkoman avatar Aug 28 '24 20:08 kirkoman

@kirkoman 🥳

wader avatar Aug 28 '24 22:08 wader