unit testing - Bash: Execute script on file save? -


When I save a file in a given directory, I use a test suite to run automatically Would like to use

:: EDIT ::

I should have mentioned that I am using OSX. Edit: You (OP) mentioned the use of OSX.

This is about the stack overflow (also marked).

For the lack of a suitable device, if you are using a specific programming language, then I recommend that you find a solution already written for it. Otherwise, I think that you are stuck for voting and managing your own changes ...

For my archive purposes, here's my original, Linux-based answer:

If you are using Linux, you can see it more specifically, you can install it, which contains inotifywait .

With it, you can monitor files and directories for many events, such as access, modification, opening, closing and many others. You can exit inotifywait after getting the specified code, and therefore a simple loop can get you whatever you want:

  while:; By the way, many programming languages ​​and environments already have their own continuous test runners (for example, with Python, you can use it with other people, modify the INOIFIFIET -A, modify some / directory / run_taiast_site < / Code> 

).


Comments