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

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

kirkoman
Copy link
Contributor

@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
Contributor 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
Contributor Author

kirkoman commented May 9, 2024

Test added (after some minor flopping and twitching).

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
Copy link
Contributor

@itchyny itchyny left a comment

Choose a reason for hiding this comment

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

Thank you!

@itchyny
Copy link
Contributor

itchyny commented Aug 20, 2024

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

@itchyny itchyny added this to the 1.8 release milestone Aug 21, 2024
@wader
Copy link
Member

wader commented Aug 23, 2024

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

@itchyny
Copy link
Contributor

itchyny commented Aug 23, 2024

Thanks!

@itchyny itchyny merged commit 6322b99 into jqlang:master Aug 23, 2024
29 checks passed
@kirkoman
Copy link
Contributor Author

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

@wader
Copy link
Member

wader commented Aug 28, 2024

@kirkoman 🥳

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.

3 participants