Browse code

Merge pull request #80 from cloudbuilders/no-sudo

No sudo chown

vishvananda authored on 2011/10/20 07:14:56
Showing 1 changed files
... ...
@@ -271,8 +271,11 @@ failed() {
271 271
 # an error.  It is also useful for following along as the install occurs.
272 272
 set -o xtrace
273 273
 
274
+# create the destination directory and ensure it is writable by the user
274 275
 sudo mkdir -p $DEST
275
-sudo chown `whoami` $DEST
276
+if [ ! -w $DEST ]; then
277
+    sudo chown `whoami` $DEST
278
+fi
276 279
 
277 280
 # Install Packages
278 281
 # ================
... ...
@@ -301,8 +304,6 @@ function git_clone {
301 301
     fi
302 302
 
303 303
     if [ ! -d $2 ]; then
304
-        sudo mkdir $2
305
-        sudo chown `whoami` $2
306 304
         git clone $1 $2
307 305
         cd $2
308 306
         # This checkout syntax works for both branches and tags