. ./.jprojects.sh || exit 255
for project in ${LIST}; do
- COMMITS_FILE="${JPROJECTS_HOME}/${project}/.gitcommits"
-
if [ "${project}" = "jprojects-scripts" ]
then
echo "$0: Skipping jprojects-scripts ..."
then
echo "$0: Project '${project}' does not exist."
continue
- elif [ ! -f "${COMMITS_FILE}" ]
+ fi
+
+ COMMITS_FILE="${JPROJECTS_HOME}/${project}/.gitcommits"
+
+ if [ ! -f "${COMMITS_FILE}" ]
then
# No .gitcommits file, skip this silently
continue
WANTED_NAME1="upstream"
WANTED_NAME2="daedalus"
WANTED_NAME3="transport"
+WANTED_NAME4="backup2"
GIT_USER="quix0r"
GIT_SERVER="git.mxchange.org"
MEDIA_BASE="/media"
MEDIA_NAME1="Backup"
MEDIA_NAME2="Transport"
+MEDIA_NAME3="Backup"
MEDIA_PATH="Java Project"
for project in ${LIST}; do
GIT_URL4="file:///E:/Java%20Project/${project}.git"
GIT_URL5="E:/Java Project/${project}.git"
GIT_URL6="${MEDIA_BASE}/${USER}/${MEDIA_NAME1}/${MEDIA_PATH}/${project}.git"
+ GIT_URL7="${MEDIA_BASE}/${USER}/${MEDIA_NAME3}/${MEDIA_PATH}/${project}.git"
echo "$0: GIT_URL1='${GIT_URL1}'"
echo "$0: GIT_URL2='${GIT_URL2}'"
echo "$0: GIT_URL3='${GIT_URL3}'"
echo "$0: GIT_URL4='${GIT_URL4}'"
echo "$0: GIT_URL5='${GIT_URL5}'"
echo "$0: GIT_URL6='${GIT_URL6}'"
+ echo "$0: GIT_URL7='${GIT_URL7}'"
if [ "$1" = "l" ]
then
git remote add "${WANTED_NAME1}" "${GIT_URL1}"
git remote add "${WANTED_NAME2}" "${GIT_URL2}"
git remote add "${WANTED_NAME3}" "${GIT_URL3}"
+ git remote add "${WANTED_NAME4}" "${GIT_URL4}"
else
echo "$0: Don't know how to create repositories, maybe unsupported."
exit 1
UPSTREAM_REMOTE1=$(git remote | grep "${WANTED_NAME1}")
UPSTREAM_REMOTE2=$(git remote | grep "${WANTED_NAME2}")
UPSTREAM_REMOTE3=$(git remote | grep "${WANTED_NAME3}")
- echo "$0: UPSTREAM_REMOTE1='${UPSTREAM_REMOTE1}',UPSTREAM_REMOTE2='${UPSTREAM_REMOTE2}',UPSTREAM_REMOTE3='${UPSTREAM_REMOTE3}'"
+ UPSTREAM_REMOTE4=$(git remote | grep "${WANTED_NAME4}")
+ echo "$0: UPSTREAM_REMOTE1='${UPSTREAM_REMOTE1}',UPSTREAM_REMOTE2='${UPSTREAM_REMOTE2}',UPSTREAM_REMOTE3='${UPSTREAM_REMOTE3},UPSTREAM_REMOTE4='${UPSTREAM_REMOTE4}'"
if [ -n "${UPSTREAM_REMOTE1}" ]
then
echo "$0: No wanted '${WANTED_NAME3}' in '${project}'. Adding ..."
git remote add "${WANTED_NAME3}" "${GIT_URL3}" --track "${GIT_BRANCH}" || exit 255
fi
+
+ if [ -n "${UPSTREAM_REMOTE4}" ]
+ then
+ echo "$0: Remote '${WANTED_NAME4}' found in '${project}'."
+ elif [ ! -d "${GIT_URL4}" ]
+ then
+ echo "$0: Remote '${WANTED_NAME4}' cannot be created, path '${GIT_URL4}' missing."
+ else
+ echo "$0: No wanted '${WANTED_NAME4}' in '${project}'. Adding ..."
+ git remote add "${WANTED_NAME4}" "${GIT_URL4}" --track "${GIT_BRANCH}" || exit 255
+ fi
fi
echo "$0: Setting upstream to '${GIT_ORIGIN}/${GIT_BRANCH}' ..."