Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kirkoman
Copy link

@kirkoman kirkoman commented May 7, 2024

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

@wader
Copy link
Member

wader commented May 8, 2024

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!

@itchyny itchyny added the windows label May 8, 2024
@kirkoman
Copy link
Author

kirkoman commented May 8, 2024

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 kirkoman force-pushed the fix/jqlang-3104 branch 2 times, most recently from ab33e86 to 4396b78 Compare May 9, 2024 11:45
src/linker.c Show resolved Hide resolved
@kirkoman
Copy link
Author

kirkoman commented May 9, 2024

Test added (after some minor flopping and twitching).

@kirkoman kirkoman requested a review from wader May 9, 2024 21:33
Copy link
Member

@wader wader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! let's see if some other maintainer has opinions

@wader wader requested a review from nicowilliams May 14, 2024 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants