We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi there,
I have this following script:
sqtoken="myToken" project_name=proj_name sonar_search=`curl -u $sqtoken: http://my.sonar.it/api/projects/search?projects=$project_name` echo $sonar_search | jq 'if (.components == []) then empty else .components end'
I need to add a curl -X POST http:// inside the first if in jq, How can I do that?
Thanks a lot
The text was updated successfully, but these errors were encountered:
@nicowilliams this is your moment :) @sagolab please see pr #1843 , it will add the possibility of running external process from within JQ
Sorry, something went wrong.
@leonid-s-usov ok thanks a lot. So is not possible yet..
Yeah, #1843 is the thing for this. Soon.
I don't understand the question.
Anyway you can easily run commands piping to sh.
sh
Here is an example: (I don't think it's correct since .components would be an array, but I don't know how else to interpret the question.)
.components
curl -fGu "$sqtoken:" --data-raw "projects=$project_name" \ http://my.sonar.it/api/projects/search | jq -r ' .components | select(. != []) | @sh "curl -gfX POST http://\(.components)"' | sh
Closing...
No branches or pull requests
Hi there,
I have this following script:
I need to add a curl -X POST http:// inside the first if in jq,
How can I do that?
Thanks a lot
The text was updated successfully, but these errors were encountered: