Qard / onchange

Use glob patterns to watch file sets and run a command when anything is added, changed or deleted.
MIT License
815 stars 47 forks source link

What I want to do is execute some other script after the file has changed and "prettier" formatted #127

Closed IceApriler closed 2 years ago

IceApriler commented 2 years ago
onchange \"src/**/*.js\" \"src/**/*.scss\" \"src/**/*.json\" -e \"{node_modules}\" -- prettier --write {{changed}} && echo 'echo some thing'

Hello, What I want to do is execute some other script after the file has changed and "prettier" formatted. What should I do?

blakeembrey commented 2 years ago

There's a similar answer here: https://github.com/Qard/onchange/issues/4#issuecomment-752642333. The approach is to basically write what you want as a shell script. You might also be able to use -o for this but I haven't tested it.