Switch to include, document watchlist functionality

This commit is contained in:
thespad
2025-01-19 17:30:11 +00:00
parent 02ed03a455
commit 21b5a79e06
3 changed files with 8 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ if [[ ${SWAG_AUTORELOAD,,} == "true" ]]; then
echo "Auto-reload: Watching the following files/folders for changes (excluding .sample, .swp, and .md files):"
echo "/config/nginx"
ACTIVE_WATCH=("/config/nginx")
for i in $(echo "${WATCHLIST}" | tr "|" " "); do
for i in $(echo "${SWAG_AUTORELOAD_WATCHLIST}" | tr "|" " "); do
if [ -f "${i}" ] || [ -d "${i}" ]; then
echo "${i}"
ACTIVE_WATCH+=("${i}")
@@ -19,7 +19,7 @@ if [[ ${SWAG_AUTORELOAD,,} == "true" ]]; then
function wait_for_changes {
inotifywait -rq \
--event modify,move,create,delete \
--excludei '\.(sample|md|swp)' \
--include '\.(conf)' \
"${ACTIVE_WATCH[@]}"
}