mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-11 03:43:30 +08:00
fix: add POSIX fallback for observer lazy-start
This commit is contained in:
@@ -352,7 +352,7 @@ if [ "$OBSERVER_ENABLED" = "true" ]; then
|
|||||||
fi
|
fi
|
||||||
) 9>"$LAZY_START_LOCK"
|
) 9>"$LAZY_START_LOCK"
|
||||||
else
|
else
|
||||||
# macOS fallback: use lockfile if available, otherwise skip
|
# macOS fallback: use lockfile if available, otherwise mkdir-based lock
|
||||||
if command -v lockfile >/dev/null 2>&1; then
|
if command -v lockfile >/dev/null 2>&1; then
|
||||||
# Use subshell to isolate exit and add trap for cleanup
|
# Use subshell to isolate exit and add trap for cleanup
|
||||||
(
|
(
|
||||||
@@ -365,6 +365,17 @@ if [ "$OBSERVER_ENABLED" = "true" ]; then
|
|||||||
fi
|
fi
|
||||||
rm -f "$LAZY_START_LOCK" 2>/dev/null || true
|
rm -f "$LAZY_START_LOCK" 2>/dev/null || true
|
||||||
)
|
)
|
||||||
|
else
|
||||||
|
# POSIX fallback: mkdir is atomic -- fails if dir already exists
|
||||||
|
(
|
||||||
|
trap 'rmdir "${LAZY_START_LOCK}.d" 2>/dev/null || true' EXIT
|
||||||
|
mkdir "${LAZY_START_LOCK}.d" 2>/dev/null || exit 0
|
||||||
|
_CHECK_OBSERVER_RUNNING "${PROJECT_DIR}/.observer.pid" || true
|
||||||
|
_CHECK_OBSERVER_RUNNING "${CONFIG_DIR}/.observer.pid" || true
|
||||||
|
if [ ! -f "${PROJECT_DIR}/.observer.pid" ] && [ ! -f "${CONFIG_DIR}/.observer.pid" ]; then
|
||||||
|
nohup "${SKILL_ROOT}/agents/start-observer.sh" start >/dev/null 2>&1 &
|
||||||
|
fi
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user