Skip to content

Fix file watcher #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix file watcher #18

wants to merge 2 commits into from

Conversation

PatOConnor43
Copy link
Owner

@PatOConnor43 PatOConnor43 commented May 2, 2021

Problem

My initial guard against setting up multiple fswatch instance ran into some race conditions.

Solution

Use pidof instead of grepping through ps looking for an existing process.

Caveats

This can still run multiple instance if the script is started from different directories. As an example:

  • Starting it from within the tools directory (tools/dart_version_watcher.sh)
  • Starting it from home ($HOME/.asdf/plugins/dart/tools/dart_version_watcher.sh)

I don't know why anyone would do that so I'm not going to worry about it for now.

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.

1 participant