clone to a directory owned by correct user
diff --git a/stack.sh b/stack.sh
index 93b665a..b89a3b1 100755
--- a/stack.sh
+++ b/stack.sh
@@ -122,9 +122,13 @@
# install python requirements
sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $FILES/pips/*`
-# git clone only if directory doesn't exist already
+# git clone only if directory doesn't exist already. Since ``DEST`` might not
+# be owned by the installation user, we create the directory and change the
+# ownership to the proper user.
function git_clone {
if [ ! -d $2 ]; then
+ sudo mkdir $2
+ sudo chown `whoami` $2
git clone $1 $2
fi
}