clone to a directory owned by correct user
This commit is contained in:
parent
1ec9d79ea1
commit
d61db8597f
1 changed files with 5 additions and 1 deletions
6
stack.sh
6
stack.sh
|
@ -122,9 +122,13 @@ sudo apt-get install -y -q `cat $FILES/apts/* | cut -d\# -f1 | grep -Ev "mysql-s
|
||||||
# install python requirements
|
# install python requirements
|
||||||
sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $FILES/pips/*`
|
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 {
|
function git_clone {
|
||||||
if [ ! -d $2 ]; then
|
if [ ! -d $2 ]; then
|
||||||
|
sudo mkdir $2
|
||||||
|
sudo chown `whoami` $2
|
||||||
git clone $1 $2
|
git clone $1 $2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue