Closed tom-doerr closed 7 months ago
Hi, first of all, my sincerest apologies for taking so long to review this!
I have tested your code, and it works nicely.
However, I noticed something strange when the -k
switch is enabled: a file change event seems to be triggered twice, as opposed to without the switch:
$ when-changed -v file -c bash -c 'while sleep 1; do echo $$; done'
When 'file' changes, run 'bash -c while sleep 1; do echo $$; done'
==> '/home/joh/code/when-changed/file' modified <==
1544891
1544891
1544891
When 'file' changes, run 'bash -c while sleep 1; do echo $$; done'
==> '/home/joh/code/when-changed/file' modified <==
==> '/home/joh/code/when-changed/file' modified <==
1544989
1544989
1544989
Also, the code seems to rely on os.setsid
, os.getpgid
and os.killpg
, which I believe are only available on POSIX systems (and not on Windows). Are there other ways to achieve the same which are cross-platform?
@tom-doerr Do you plan to continue with this PR? Will close otherwise.
Hi @joh, no, I can't remember what was going on in this PR
Attempt on adding #61 .