pow.plugin.zsh 618 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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
#
# Thanks also to Christopher Sexton
Andrew Hodges's avatar
Andrew Hodges committed
16
# https://gist.github.com/965032
17
#
Andrew Hodges's avatar
Andrew Hodges committed
18
function kapow {
19
20
21
22
	FOLDERNAME=$1
	if [ -z "$FOLDERNAME" ]; then; FOLDERNAME=${PWD##*/}; fi
	touch ~/.pow/$FOLDERNAME/tmp/restart.txt;
	if [ $? -eq 0 ]; then; echo "pow: restarting $FOLDERNAME" ; fi
Andrew Hodges's avatar
Andrew Hodges committed
23
24
25
}

compctl -W ~/.pow -/ kapow