#!/usr/bin/env fish echo "watchPWD: $(pwd)" set DIRECTORY_TO_WATCH "./src" set SCRIPT_TO_RUN "echo a && leptosfmt $(pwd) && rustywind --write ./src && echo b" while true # Wait for any change in the directory inotifywait -r -e modify,create,delete,move $DIRECTORY_TO_WATCH # Run your script bash -c "$SCRIPT_TO_RUN" sleep 5 end