mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-25 23:30:08 +00:00
bug : stop creating those ~ directories
add powit command to symlink an app if it hasn't been already
This commit is contained in:
parent
3841da15d0
commit
f9b4356e0e
1 changed files with 15 additions and 2 deletions
|
@ -34,6 +34,7 @@ rack_root_detect(){
|
||||||
[[ ${basedir} == "/" ]] && return 1
|
[[ ${basedir} == "/" ]] && return 1
|
||||||
echo `basename $basedir | sed -E "s/.(com|net|org)//"`
|
echo `basename $basedir | sed -E "s/.(com|net|org)//"`
|
||||||
}
|
}
|
||||||
|
|
||||||
kapow(){
|
kapow(){
|
||||||
local vhost=$1
|
local vhost=$1
|
||||||
[ ! -n "$vhost" ] && vhost=$(rack_root_detect)
|
[ ! -n "$vhost" ] && vhost=$(rack_root_detect)
|
||||||
|
@ -43,11 +44,23 @@ kapow(){
|
||||||
return 1
|
return 1
|
||||||
fi
|
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;
|
touch ~/.pow/$vhost/tmp/restart.txt;
|
||||||
[ $? -eq 0 ] && echo "pow: restarting $vhost.dev"
|
[ $? -eq 0 ] && echo "pow: restarting $vhost.dev"
|
||||||
}
|
}
|
||||||
compctl -W ~/.pow -/ kapow
|
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
|
# View the standard out (puts) from any pow app
|
||||||
alias kaput="tail -f ~/Library/Logs/Pow/apps/*"
|
alias kaput="tail -f ~/Library/Logs/Pow/apps/*"
|
Loading…
Reference in a new issue