-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Path argument changed by jq #1935
Comments
Because what jq sees is the string inside the quotes; the quotes only matter for the shell, I think. In a similar way, I don't think jq ever sees I have no way to try this, but from the document, I'd try this:
and try to figure out a way to deal with the trailing Btw, you can pass
|
Thanks for the -n hint 😃 I wasn't sure the issue was something happening before jq or in jq, so the quotes were an attempt to prevent the shell from messing with it. I had no idea mingw was converting paths outside the scope of the shell, depending on whether the command being called was 'native' or not.
Maybe there is a way to compile jq so it can be used by gitbash/mingw more 'natively' (kind of like the nano port)? I'm not sure if simply linking the dll would fix this issue, or if it would cause other compatibility issues. In the meantime, I was able to work around the issue by passing the value wrapped with |
Would switching to WSL be another workaround? |
Msys Bash will convert Unix-style path to Windows-style. Add environment It is not related to |
@srenatus In my work environment, that's not an option. It might solve the issue, though, I'm not sure. @linquize I guess a wrapper script could be created to set the environment variable, call jq, then unset the variable, but that's a bit cumbersome. |
@Incognito357 we don't currently support msys. Does the msys shell really inspect the program you're executing to decide if it needs path arguments to be converted?? and it somehow decides that some argument is intended to be a path?? |
@nicowilliams I never would have thought this was happening either, until I ran into this issue, and srenatus pointed me to the msys documentation saying that it's doing so intentionally. The rules it uses for converting paths are clear, and appear to only inspect an argument as-is, which is why wrapping the parameter in a json object is left alone. I'm not sure how msys checks if an exe depends on msys-1.0.dll, but that's how it determines that it should attempt to convert paths that it finds in the arguments. |
Describe the bug
Passing a linux-style path as an argument results in a windows-style path being returned.
To Reproduce
Case 1:
Case 2:
Expected behavior
Expected the original argument to be used as-is, and not modified at all.
Case 1: Expected result to be
"/opt/"
Case 2: Expected result to be
"/c/dev/"
Environment
Additional Information
Passing the argument value with single or double quotes does not change the behavior.
The text was updated successfully, but these errors were encountered: