X-Git-Url: https://git.mxchange.org/?p=jprojects-scripts.git;a=blobdiff_plain;f=fix-project-remotes.sh;h=f4bd38bf05d3c4f746037cd20965f97ed7338228;hp=1c75ff351eb85e81dca5c10149b1a88da89a41aa;hb=8f2d1d392f523f5279e6144bf42d1c41487a7195;hpb=e0cd31f78b0bfec22997ac90fe3f37291638ee92 diff --git a/fix-project-remotes.sh b/fix-project-remotes.sh index 1c75ff3..f4bd38b 100755 --- a/fix-project-remotes.sh +++ b/fix-project-remotes.sh @@ -46,7 +46,20 @@ for project in ${LIST}; do REMOTES=`git remote | wc -l` echo "$0: REMOTES='${REMOTES}'" - if [ "${REMOTES}" = "1" ] + if [ "${REMOTES}" = "0" ] + then + if [ -n "${SHELL}" -a -f "/proc/version" ] + then + echo "$0: Found no repositories in '${project}'. Creating all (Linux) ..." + git remote add "${GIT_ORIGIN}" "${GIT_URL6}" --track "${GIT_BRANCH}" + git remote add "${WANTED_NAME1}" "${GIT_URL1}" + git remote add "${WANTED_NAME2}" "${GIT_URL2}" + git remote add "${WANTED_NAME3}" "${GIT_URL3}" + else + echo "$0: Don't know how to create repositories, maybe unsupported." + exit 1 + fi + elif [ "${REMOTES}" = "1" ] then echo "$0: Only one remote found for '${project}'"