... | ... |
@@ -1,10 +1,25 @@ |
1 |
-# Thanks to Christopher Sexton |
|
1 |
+# Restart a rack app running under pow |
|
2 |
+# http://pow.cx/ |
|
3 |
+# |
|
4 |
+# Adds a kapow command that will restart an app |
|
5 |
+# |
|
6 |
+# $ kapow myapp |
|
7 |
+# $ kapow # defaults to current directory |
|
8 |
+# |
|
9 |
+# Supports command completion. |
|
10 |
+# |
|
11 |
+# If you are not already using completion you might need to enable it with |
|
12 |
+# |
|
13 |
+# autoload -U compinit compinit |
|
14 |
+# |
|
15 |
+# Thanks also to Christopher Sexton |
|
2 | 16 |
# https://gist.github.com/965032 |
17 |
+# |
|
3 | 18 |
function kapow { |
4 |
- touch ~/.pow/$1/tmp/restart.txt |
|
5 |
- if [ $? -eq 0 ]; then |
|
6 |
- echo "$fg[yellow]Pow restarting $1...$reset_color" |
|
7 |
- fi |
|
19 |
+ FOLDERNAME=$1 |
|
20 |
+ if [ -z "$FOLDERNAME" ]; then; FOLDERNAME=${PWD##*/}; fi |
|
21 |
+ touch ~/.pow/$FOLDERNAME/tmp/restart.txt; |
|
22 |
+ if [ $? -eq 0 ]; then; echo "pow: restarting $FOLDERNAME" ; fi |
|
8 | 23 |
} |
9 | 24 |
|
10 | 25 |
compctl -W ~/.pow -/ kapow |