From f9b4356e0ed9e95890ce79c982dd5481ba7803aa Mon Sep 17 00:00:00 2001 From: John Antoni Griffiths Date: Wed, 18 Jan 2012 18:36:11 -0500 Subject: [PATCH] bug : stop creating those ~ directories add powit command to symlink an app if it hasn't been already --- plugins/pow/pow.plugin.zsh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh index 0fbcf8c7b..399a54cb0 100644 --- a/plugins/pow/pow.plugin.zsh +++ b/plugins/pow/pow.plugin.zsh @@ -34,6 +34,7 @@ rack_root_detect(){ [[ ${basedir} == "/" ]] && return 1 echo `basename $basedir | sed -E "s/.(com|net|org)//"` } + kapow(){ local vhost=$1 [ ! -n "$vhost" ] && vhost=$(rack_root_detect) @@ -43,11 +44,23 @@ kapow(){ return 1 fi - # [ ! -d "~/.pow/${vhost}/tmp" ] && mkdir -p "~/.pow/$vhost/tmp" + [ ! -d ~/.pow/${vhost}/tmp ] && mkdir -p ~/.pow/$vhost/tmp touch ~/.pow/$vhost/tmp/restart.txt; [ $? -eq 0 ] && echo "pow: restarting $vhost.dev" } compctl -W ~/.pow -/ kapow +powit(){ + local basedir=$(pwd) + local vhost=$1 + [ ! -n "$vhost" ] && vhost=$(rack_root_detect) + if [ ! -h ~/.pow/$vhost ] + then + echo "pow: Symlinking your app with pow. ${vhost}" + [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost + return 1 + fi +} + # View the standard out (puts) from any pow app -alias kaput="tail -f ~/Library/Logs/Pow/apps/*" \ No newline at end of file +alias kaput="tail -f ~/Library/Logs/Pow/apps/*"