• Uncategorized

About linux : Bash-pipe-arguments-does-not-seem-to-pass-through-duplicate

Question Detail

I’m not a very skilled linux user and I’m trying to make an automation for vscode such that I can open all the files with diff in them in vscode. My current suggestion is:

git diff master...[BRANCH_NAME] --name-only |code -r

The first part git diff master...[BRANCH_NAME] --name-only works perfectly fine giving:

src/components/LeftDrawerMenu/TaskForm/index.js
src/services/util.js

But the code -r does not registering the output as input. It runs as if there where no arguments.

I want the following:

code -r src/services/util.js src/components/LeftDrawerMenu/TaskForm/index.js

But

code -r src/services/util.js 
code -r src/components/LeftDrawerMenu/TaskForm/index.js 

would also give the desired outcome. What do I do wrong?

Question Answer

I’m afraid that a pipe for different lines of output might not be handled correctly. Did you already try this:

code -r $(git diff master...[BRANCH_NAME] --name-only)

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.