xrforge/manyfold/root/hook.d/inotify_MODIFY/1000-scan-dir.sh

8 lines
257 B
Bash
Raw Normal View History

2025-10-28 17:57:34 +01:00
#!/bin/sh
echo "$1" | grep -E 'datapackage|glb$' || exit 0 # nothing to do
dir=$(dirname $1)
cd "$dir"
echo "[v] scan (new) files of model"
id="$(basename "$dir" | sed 's/\#//g')"
echo "Model.find(id).add_new_files_later()" | /usr/src/app/bin/rails console