question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow passing files as single arguments to system command

See original GitHub issue

Sorry if this has been asked before, but I can’t find anything in the docs, web or issues. My problem is simple, I have a “system” command that accepts one argument, so I want to run it once per file, but pre-commit passes multiple files to it. How can I avoid that and run the command once per changed file instead?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
asottilecommented, Dec 9, 2020

this is intentionally not a feature because spinning up many subprocesses one-by-one is extremely slow – the underlying tools should be fixed to support multiple

that said you can work around it as above – or as these duplicates indicate:

1reaction
skorokithakiscommented, Dec 9, 2020

That does work, thank you! Hopefully this can be added as a feature to save someone else the frustration. Thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass contents of file as argument to bash script
The some_file is a file that has 1 single line that I want to pass it as an argument to my bash script.sh...
Read more >
How do I use the lines of a file as arguments of a command?
If your shell is bash (amongst others), a shortcut for $(cat afile) is $(< afile) , so you'd write: mycommand "$(< file.txt)".
Read more >
Adding arguments and options to your Bash scripts - Red Hat
I placed this script in my ~/bin directory , where personal executable files such as scripts are intended to be stored. Look at...
Read more >
Pass the Output of a Command as an Argument for Another
First, let's create an environment where we can test our strategies. Let's create two folders – one that contains files created with certain ......
Read more >
How to pass arguments on the command line using bash script
The command -line argument is a parameter that we can pass to our Bash script during the execution time. They allow a user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found