Skip to content

Instantly share code, notes, and snippets.

@sascha-wolf
Last active May 30, 2020 18:29
Show Gist options
  • Save sascha-wolf/903f8903104242d875482f3c8b392109 to your computer and use it in GitHub Desktop.
Save sascha-wolf/903f8903104242d875482f3c8b392109 to your computer and use it in GitHub Desktop.
Restart phx.server on any code change
#!/bin/sh
while true; do
fd -e ex -e exs -e eex -e leex | entr -cr mix phx.server
# 130 is SIGTERM; everything else is an error
if [ $? -ne 130 ]; then
continue
fi
if ask 'Restart watcher?' Y; then
continue
fi
break
done
@sascha-wolf
Copy link
Author

Dependencies:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment