015b742153654c0b127f8f158ab80e51f6ea8ec3

Author
Simon Courtois <scourtois_github@cubyx.fr>
Committer
Simon Courtois <scourtois_github@cubyx.fr>
Date

Message

Allowing path with spaces in pow plugin

This commit allows for paths with spaces to be symlinked
in Pow.

If an application is located in a folder like `/some path/to the/app`
the powit command would fail when it shouldn't. It's not the case
anymore.

Diff

 1diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh
 2index 7f86c0c76ed9e051a28aa82519d11776d0c05add..d85c8877777a44e57924eda79315fdfae38c9de0 100644
 3--- a/plugins/pow/pow.plugin.zsh
 4+++ b/plugins/pow/pow.plugin.zsh
 5@@ -21,8 +21,8 @@
 6 
 7 rack_root(){
 8   setopt chaselinks
 9-  local orgdir=$(pwd)
10-  local basedir=$(pwd)
11+  local orgdir="$(pwd)"
12+  local basedir="$(pwd)"
13 
14   while [[ $basedir != '/' ]]; do
15     test -e "$basedir/config.ru" && break
16@@ -30,7 +30,7 @@ rack_root(){
17     basedir="$(pwd)"
18   done
19 
20-  builtin cd $orgdir 2>/dev/null
21+  builtin cd "$orgdir" 2>/dev/null
22   [[ ${basedir} == "/" ]] && return 1
23   echo $basedir
24 }
25@@ -56,19 +56,19 @@ kapow(){
26 compctl -W ~/.pow -/ kapow
27 
28 powit(){
29-  local basedir=$(pwd)
30+  local basedir="$(pwd)"
31   local vhost=$1
32   [ ! -n "$vhost" ] && vhost=$(rack_root_detect)
33   if [ ! -h ~/.pow/$vhost ]
34   then
35     echo "pow: Symlinking your app with pow. ${vhost}"
36-    [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost
37+    [ ! -d ~/.pow/${vhost} ] && ln -s "$basedir" ~/.pow/$vhost
38     return 1
39   fi
40 }
41 
42 powed(){
43-  local basedir=$(rack_root)
44+  local basedir="$(rack_root)"
45   find ~/.pow/ -type l -lname "*$basedir*" -exec basename {}'.dev' \;
46 }
47 
48@@ -82,4 +82,4 @@ repow(){
49 }
50 
51 # View the standard out (puts) from any pow app
52-alias kaput="tail -f ~/Library/Logs/Pow/apps/*"
53+alias kaput="tail -f ~/Library/Logs/Pow/apps/*"