浏览代码

fix for pow plugin to default to current dir

John Antoni Griffiths 13 年之前
父节点
当前提交
741f6747e4
共有 1 个文件被更改,包括 20 次插入5 次删除
  1. 20 5
      plugins/pow/pow.plugin.zsh

+ 20 - 5
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
 # https://gist.github.com/965032
+#
 function kapow {
 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
 compctl -W ~/.pow -/ kapow