Skip to content

Conversation

@tom-doerr
Copy link

Attempt on adding #61 .

@joh
Copy link
Owner

joh commented Aug 17, 2022

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?

@joh
Copy link
Owner

joh commented Apr 2, 2024

@tom-doerr Do you plan to continue with this PR? Will close otherwise.

@tom-doerr
Copy link
Author

Hi @joh, no, I can't remember what was going on in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants