Skip to content

Instantly share code, notes, and snippets.

@scottwater
Forked from csexton/kapow.zsh
Created May 13, 2011 04:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottwater/969974 to your computer and use it in GitHub Desktop.
Save scottwater/969974 to your computer and use it in GitHub Desktop.
Zsh function to restart an app running under pow
# 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
@csexton
Copy link

csexton commented May 13, 2011

This is handy, thanks

@csexton
Copy link

csexton commented Jun 10, 2011

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