-
-
Save scottwater/969974 to your computer and use it in GitHub Desktop.
Zsh function to restart an app running under pow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Restart a rack app running under pow | |
# http://pow.cx/ | |
# | |
# Adds a kapow command that will restart an app | |
# | |
# $ kapow myapp | |
# $ kapow # defaults to current directory | |
# | |
# Supports command completion. | |
# | |
# If you are not already using completion you might need to enable it with | |
# | |
# autoload -U compinit compinit | |
# | |
kapow(){ | |
FOLDERNAME=$1 | |
if [ -z "$FOLDERNAME" ]; then; FOLDERNAME=${PWD##*/}; fi | |
touch ~/.pow/$FOLDERNAME/tmp/restart.txt; | |
if [ $? -eq 0 ]; then; echo "pow: restarting $FOLDERNAME" ; fi | |
} | |
compctl -W ~/.pow -/ kapow |
Made this a bit smarter (and way more complex) in 70dbb4. Now it will walk up the tree to find the name of the app to restart.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is handy, thanks