Skip to content

Fix file watcher#18

Open
PatOConnor43 wants to merge 2 commits into
masterfrom
fix-file-watcher
Open

Fix file watcher#18
PatOConnor43 wants to merge 2 commits into
masterfrom
fix-file-watcher

Conversation

@PatOConnor43
Copy link
Copy Markdown
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