summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Antoni Griffiths <john@johnantoni.com>2012-01-18 12:52:27 -0500
committerJohn Antoni Griffiths <john@johnantoni.com>2012-01-18 12:52:27 -0500
commit741f6747e418229deec62ae2d19c776f6494e219 (patch)
tree0efc9a739176bdfc672c227288071e794b05e2b0
parentf4944d5a9537eb4bdc4991fe63e6d249f9e5b478 (diff)
downloadzsh-741f6747e418229deec62ae2d19c776f6494e219.tar.gz
zsh-741f6747e418229deec62ae2d19c776f6494e219.tar.bz2
zsh-741f6747e418229deec62ae2d19c776f6494e219.zip
fix for pow plugin to default to current dir
-rw-r--r--plugins/pow/pow.plugin.zsh25
1 files changed, 20 insertions, 5 deletions
diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh
index 6b2a6f2be..da94b657b 100644
--- a/plugins/pow/pow.plugin.zsh
+++ b/plugins/pow/pow.plugin.zsh
@@ -1,10 +1,25 @@
-# Thanks to Christopher Sexton
+# 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
# https://gist.github.com/965032
+#
function kapow {
- touch ~/.pow/$1/tmp/restart.txt
- if [ $? -eq 0 ]; then
- echo "$fg[yellow]Pow restarting $1...$reset_color"
- fi
+ 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