mirror of
https://github.com/ldericher/autodoc.git
synced 2025-12-06 15:43:01 +00:00
36 lines
636 B
Bash
Executable file
36 lines
636 B
Bash
Executable file
#!/bin/bash
|
|
|
|
#
|
|
# hard globals
|
|
#
|
|
|
|
g_bin="$(readlink -f "$(which "$0")")"
|
|
g_lib=${g_bin/"bin"/"lib"}
|
|
declare -a g_build_systems
|
|
declare -A g_build_systems_glob
|
|
|
|
#
|
|
# load base program
|
|
#
|
|
|
|
source "${g_lib}/globals"
|
|
source "${g_lib}/plugins/"*".sh"
|
|
source "${g_lib}/handle_inotify"
|
|
|
|
#
|
|
# MAIN
|
|
#
|
|
|
|
echo "Booting '${g_bin}' in '${g_watchroot}'."
|
|
# setup inotify:
|
|
# -mrq monitor, recursive, quiet
|
|
# -e events
|
|
# --format %e eventlist csv, %w workdir, %f filename
|
|
inotifywait -mrq \
|
|
-e create -e delete -e moved_to -e close_write \
|
|
--format '%e %w%f' \
|
|
"${g_watchroot}" | \
|
|
\
|
|
while read NOTIFICATION; do
|
|
do_handle ${NOTIFICATION}
|
|
done
|