Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

Commit 808f5d4

Browse files
matejvasekclaude
andcommitted
fix: guard inotifywait against silent failure
set -e is inherited by the watcher subshell. If inotifywait exits non-zero (e.g. watched directory deleted, watch limit exhausted), the subshell dies silently. Guard with if-check and shut down on failure instead. Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 138fb21 commit 808f5d4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

init.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ start_backend_watcher() {
9393
echo "Starting backend file watcher..."
9494
(
9595
while true; do
96-
inotifywait -r -e modify,create,delete,move --include '\.(go|mod|sum)$' backend/ >/dev/null 2>&1
96+
if ! inotifywait -r -e modify,create,delete,move --include '\.(go|mod|sum)$' backend/ >/dev/null 2>&1; then
97+
echo "[watcher] inotifywait failed. Shutting down dev environment."
98+
stop_dev
99+
break
100+
fi
97101
sleep 1 # debounce
98102

99103
echo "[watcher] Detected change, rebuilding backend..."

0 commit comments

Comments
 (0)