]>
git.rmz.io Git - dotfiles.git/blob - zsh/plugins/pow/pow.plugin.zsh
399a54cb02aae802afb95f72a343b35b1412f779
1 # Restart a rack app running under pow
4 # Adds a kapow command that will restart an app
8 # Supports command completion.
10 # If you are not already using completion you might need to enable it with
12 # autoload -U compinit compinit
16 # Defaults to the current application, and will walk up the tree to find
17 # a config.ru file and restart the corresponding app
19 # Will Detect if a app does not exist in pow and print a (slightly) helpful
27 while [[ $basedir != '/' ]]; do
28 test -e "$basedir/config.ru" && break
29 builtin cd ".." 2>/dev
/null
33 builtin cd $orgdir 2>/dev
/null
34 [[ ${basedir} == "/" ]] && return 1
35 echo `basename $basedir | sed -E "s/.(com|net|org)//"`
40 [ ! -n "$vhost" ] && vhost
=$(rack_root_detect)
41 if [ ! -h ~
/.pow
/$vhost ]
43 echo "pow: This domain isn’t set up yet. Symlink your application to ${vhost} first."
47 [ ! -d ~
/.pow
/${vhost}/tmp
] && mkdir -p ~
/.pow
/$vhost/tmp
48 touch ~
/.pow
/$vhost/tmp
/restart.txt
;
49 [ $?
-eq 0 ] && echo "pow: restarting $vhost.dev"
51 compctl
-W ~
/.pow
-/ kapow
56 [ ! -n "$vhost" ] && vhost
=$(rack_root_detect)
57 if [ ! -h ~
/.pow
/$vhost ]
59 echo "pow: Symlinking your app with pow. ${vhost}"
60 [ ! -d ~
/.pow
/${vhost} ] && ln -s $basedir ~
/.pow
/$vhost
65 # View the standard out (puts) from any pow app
66 alias kaput
="tail -f ~/Library/Logs/Pow/apps/*"