`xargs` provides a really nice mechanism to pipe r...
# general
h
xargs
provides a really nice mechanism to pipe results into successive
pants
calls. Is there a similar pattern for joining results of two
pants
calls? My use case is pretty non-standard, but I would like to run something like
pants <find a buch of targets> && pants <find a bunch of different targets> | xargs pants test
.
e
Just use command substitution is one way
pants test $(...) $(...)
h
The specific things I want to join are • unit tests that are 3 dependee layers away from resource/file targets • unit tests that are 2 dependee layers away from python_source targets
e
or
cat <(...) <(...) | xargs pants
Lots of ways!
h
Command substitution is similar to what I had come up with so sounds like that's the way to keep going!
e
Maybe just group the way your doing a subshell
(... && ...) | pants test
Copy code
$ (echo bob && echo jane) | nl
     1  bob
     2  jane
VS:
Copy code
$ echo bob && echo jane | nl
bob
     1  jane
h
Very cool
e
My undergrad was Physics and my department required 1 year of electronics, 1/2 analog, 1/2 digital and provided seminars on things like using a shell. It was csh, but still - these seemingly weird dept. requirements have been super useful!
Knowing thy shell was deemed important and boy were they right!!
🚀 1