Thursday, 27 April 2017

Using jq to extract information about dependencies from package.json

So I am trying to run a jq command inside a makefile to link some dependencies, and I do not understand what the line inside the do-done does. If using only echo "$$dep" I understand what's going on, but when using the full line of code ([ -f "$$dep/package.json" ] && echo "$$dep";) I seem to be lost. Does anyone have any idea? Thanks.

jq -r '.dependencies,.devDependencies|keys[]' $< | while read -r dep; do \
    [ -f "$$dep/package.json" ] && echo "$$dep"; \
done | (piping forward)



via bgiuga

No comments:

Post a Comment