Add support to have custom directory name for cloned repo

This commit is contained in:
Rakholiya Jenish 2016-08-27 05:06:40 +05:30 committed by radare
parent e9e8ae3629
commit 66772837c0

View File

@ -147,14 +147,18 @@ R2PM_ListUninstalled() {
R2PM_GIT() {
URL="$1"
if [ -z "$2" ]; then
DIR="`basename $1`"
else
DIR="$2"
fi
cd "${R2PM_GITDIR}"
if [ ${IS_LOCAL} = 0 ]; then
if [ -d "${R2PM_GITDIR}/${DIR}" ]; then
cd "${DIR}"
git pull
else
git clone "${URL}" || R2PM_FAIL "Oops"
git clone "${URL}" "${DIR}" || R2PM_FAIL "Oops"
cd "${DIR}" || R2PM_FAIL "Oops"
fi
fi