Skip to content

Commit

Permalink
Merge pull request #1114 from radian-software/rr-watcher-improvements
Browse files Browse the repository at this point in the history
Fix two issues that were breaking fs watcher
  • Loading branch information
raxod502 authored Aug 18, 2023
2 parents 8e0924c + 85d4140 commit 79d02a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions watcher/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
name="straight-watcher",
url="https://github.com/radian-software/straight.el",
version="1.0-dev",
# Must be specified explicitly from setuptools>=61
# https://github.com/pypa/setuptools/issues/4013
py_modules=["straight_watch", "straight_watch_callback"],
)
4 changes: 3 additions & 1 deletion watcher/straight_watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def write_process_data(pid_file):
def start_watch(repos_dir, modified_dir):
callback_cmd = [CALLBACK_SCRIPT, repos_dir, modified_dir]
callback_sh = " ".join(map(shlex.quote, callback_cmd))
cmd = ["watchexec", "--no-vcs-ignore", "-p", "-d", "100", callback_sh]
# Use --debounce explicitly as some versions of watchexec do not support -d
# https://github.com/watchexec/watchexec/pull/513#issuecomment-1683304057
cmd = ["watchexec", "--no-vcs-ignore", "-p", "--debounce", "100", callback_sh]
cmd_sh = " ".join(map(shlex.quote, cmd))
print("$ " + cmd_sh, file=sys.stderr)
subprocess.run(cmd, cwd=repos_dir, check=True)
Expand Down

0 comments on commit 79d02a0

Please sign in to comment.