Skip to content

feat(watch): pure-shell polling fallback when watchers are missing#793

Merged
Chemaclass merged 1 commit into
mainfrom
feat/779-watch-polling-fallback
Jul 14, 2026
Merged

feat(watch): pure-shell polling fallback when watchers are missing#793
Chemaclass merged 1 commit into
mainfrom
feat/779-watch-polling-fallback

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #779

The watch subcommand hard-failed when neither inotifywait nor fswatch was installed — a dead end on CI containers, fresh macOS machines, and minimal images.

💡 Changes

  • watch now degrades to a pure-shell polling loop instead of exiting, printing a one-line notice; installing a watcher still gives instant, event-driven triggers
  • Change detection uses find -newer against a sentinel (POSIX, no GNU/BSD stat divergence); created/modified .sh files trigger a rerun, deletions are not detected on this path
  • Interval configurable via BASHUNIT_WATCH_INTERVAL (default 2s, positive integer, invalid values fall back to the default)
  • Docs (watch subcommand + configuration) and CHANGELOG updated

… missing

The 'watch' subcommand hard-failed when neither watcher was installed.
It now degrades to a pure-shell polling loop (find -newer sentinel),
prints a one-line notice, and reruns on created/modified .sh files.
Interval configurable via BASHUNIT_WATCH_INTERVAL (default 2s, positive
integer, invalid values fall back to default).

Closes #779
@Chemaclass Chemaclass added the enhancement New feature or request label Jul 14, 2026
@Chemaclass Chemaclass self-assigned this Jul 14, 2026
@Chemaclass Chemaclass merged commit 49064ed into main Jul 14, 2026
66 of 69 checks passed
@Chemaclass Chemaclass deleted the feat/779-watch-polling-fallback branch July 14, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant