Hi I am trying to write a shell command that does:
- watch a folder
- when a file has changed copy that new file somewhere
- then runs a make task
fswatch ./src | xargs -I {} cp {} ./otherfolder
the first 2 things are working with the command above, but I cannot figure out how to run a command after this.
I've tried
fswatch ./src | xargs -I {} cp {} ./otherfolder && make
That doesn't work because the && are conflicting with xargs I think
fswatch ./src | xargs -I {} cp {} ./otherfolder | make
Here the make command is immediately called, not after the copying is done. (It's even called before fswatch triggers on a change)
Is it possible to run a command after the cp using xargs?