640e5da6885ac39697f7c4ad6683af21fa1b8b96

Author
cmar <chris@spreecommerce.com>
Committer
Phil Eichinger <phil@zankapfel.net>
Date

Message

added powed command to list pow urls

Diff

 1diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh
 2index 399a54cb02aae802afb95f72a343b35b1412f779..c823cdb22424f22bc136a5f6f7ea4dd967eb669c 100644
 3--- a/plugins/pow/pow.plugin.zsh
 4+++ b/plugins/pow/pow.plugin.zsh
 5@@ -8,18 +8,18 @@
 6 # Supports command completion.
 7 #
 8 # If you are not already using completion you might need to enable it with
 9-# 
10+#
11 #    autoload -U compinit compinit
12 #
13 # Changes:
14 #
15-# Defaults to the current application, and will walk up the tree to find 
16+# Defaults to the current application, and will walk up the tree to find
17 # a config.ru file and restart the corresponding app
18 #
19-# Will Detect if a app does not exist in pow and print a (slightly) helpful 
20+# Will Detect if a app does not exist in pow and print a (slightly) helpful
21 # error message
22 
23-rack_root_detect(){
24+rack_root(){
25   setopt chaselinks
26   local orgdir=$(pwd)
27   local basedir=$(pwd)
28@@ -32,6 +32,11 @@ rack_root_detect(){
29 
30   builtin cd $orgdir 2>/dev/null
31   [[ ${basedir} == "/" ]] && return 1
32+  echo $basedir
33+}
34+
35+rack_root_detect(){
36+  basedir=$(rack_root)
37   echo `basename $basedir | sed -E "s/.(com|net|org)//"`
38 }
39 
40@@ -51,16 +56,21 @@ kapow(){
41 compctl -W ~/.pow -/ kapow
42 
43 powit(){
44-	local basedir=$(pwd)
45+  local basedir=$(pwd)
46   local vhost=$1
47   [ ! -n "$vhost" ] && vhost=$(rack_root_detect)
48   if [ ! -h ~/.pow/$vhost ]
49-	then
50-		echo "pow: Symlinking your app with pow. ${vhost}"
51-	  [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost
52+  then
53+    echo "pow: Symlinking your app with pow. ${vhost}"
54+    [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost
55     return 1
56   fi
57 }
58 
59+powed(){
60+  local basedir=$(rack_root)
61+  find ~/.pow/ -type l -lname "*$basedir*" -exec basename {}'.dev' \;
62+}
63+
64 # View the standard out (puts) from any pow app
65-alias kaput="tail -f ~/Library/Logs/Pow/apps/*"
66+alias kaput="tail -f ~/Library/Logs/Pow/apps/*"