]> git.mxchange.org Git - jprojects-scripts.git/commitdiff
More stuff added for Windows development (silly)
authorRoland Häder <roland@mxchange.org>
Wed, 4 May 2016 10:21:16 +0000 (12:21 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 4 May 2016 10:21:16 +0000 (12:21 +0200)
Signed-off-by: Roland Haeder <roland@haeder.net>
.jprojects.sh
fix-project-remotes.sh
pull-stick.sh
push-stick.sh

index 840c300dd246c46a433df372378d5689accff177..a8e43f79363e2d384f3965dfc714f70dfea08b0a 100644 (file)
@@ -11,7 +11,6 @@ LIST="${LIST} \
        jphone-core jphone-lib \
        jcontacts-core jcontacts-business-core jcontacts-lib \
        juser-core juser-lib \
-       jaddressbook-core \
        jletter-core jletter-lib jletter-ejb \
        jaddressbook-core jaddressbook-lib \
        jmailer-ee \
index ebfb1da20b618bc04b3637bd9e1e64eb233d7e5d..cd51a97f8be1fe157e7aa3bf44d2449d56b6129f 100755 (executable)
@@ -19,28 +19,27 @@ MEDIA_NAME2="Transport"
 MEDIA_PATH="Java Project"
 
 for project in ${LIST}; do
-       echo "$0: project='${project}'"
-       SKIP_TEST="${project:0:9}"
-
-       if [ "${SKIP_TEST}" = "jratecalc" ]
+       if [ ! -d "${JPROJECTS_HOME}/${project}" ]
        then
-               echo "$0: Not fixing URLs for jratecalc project '${project}'."
                continue
        fi
 
+       echo "$0: project='${project}'"
+
        GIT_URL1="${GIT_USER}@${GIT_SERVER}:${GIT_PATH}/${project}.git"
        GIT_URL2="${GIT_PATH}/${project}.git"
        GIT_URL3="${MEDIA_BASE}/${USER}/${MEDIA_NAME2}/${MEDIA_PATH}/${project}.git"
-       echo "$0: GIT_URL1='${GIT_URL1}',GIT_URL2='${GIT_URL2}',GIT_URL3='${GIT_URL3}'"
+       GIT_URL4="file:///E:/Java%20Project/${project}.git"
+       GIT_URL5="E:/Java Project/${project}.git"
+       echo "$0: GIT_URL1='${GIT_URL1}',GIT_URL2='${GIT_URL2}',GIT_URL3='${GIT_URL3}',GIT_URL4='${GIT_URL4}',GIT_URL5='${GIT_URL5}'"
 
-       cd "${project}"
+       cd "${JPROJECTS_HOME}/${project}" || exit 255
 
        if [ "$1" = "l" ]
        then
                echo "$0: Listing remotes for '${project}' ..."
                git remote -v
-               cd -
-               continue;
+               continue
        fi
 
        REMOTES=`git remote | wc -l`
@@ -70,13 +69,15 @@ for project in ${LIST}; do
                else
                        echo "$0: Not a media remote."
                        MXCHANGE_REMOTE=`echo "${REMOTE_PUSH}" | grep "${GIT_URL1}"`
-                       echo "$0: MXCHANGE_REMOTE='${MXCHANGE_REMOTE}'"
+                       WINDOWS_FILE_REMOTE=`echo "${REMOTE_PUSH}" | grep "${GIT_URL4}"`
+                       WINDOWS_PATH_REMOTE=`echo "${REMOTE_PUSH}" | grep "${GIT_URL5}"`
+                       echo "$0: MXCHANGE_REMOTE='${MXCHANGE_REMOTE}',WINDOWS_FILE_REMOTE='${WINDOWS_FILE_REMOTE}',WINDOWS_PATH_REMOTE='${WINDOWS_PATH_REMOTE}'"
 
                        if [ -n "${MXCHANGE_REMOTE}" ]
                        then
                                echo "$0: Found a '${GIT_SERVER}' remote."
 
-                               if [ "${REMOTE}" != "${WANTED_NAME1}" ]
+                               if [ -n "${WANTED_NAME1}" -a "${REMOTE}" != "${WANTED_NAME1}" ]
                                then
                                        echo "$0: Project '${project}' has one correct '${WANTED_NAME1}'."
                                else
@@ -86,6 +87,20 @@ for project in ${LIST}; do
 
                                echo "$0: Adding '${GIT_ORIGIN}' to '${project}' ..."
                                git remote add "${GIT_ORIGIN}" "${MEDIA_BASE}/${USER}/${MEDIA_NAME1}/${MEDIA_PATH}/${project}.git" --track "${GIT_BRANCH}" || exit 255
+                       elif [ -n "${WINDOWS_FILE_REMOTE}" -o -n "${WINDOWS_PATH_REMOTE}" ]
+                       then
+                               echo "$0: Found a Windows (USB stick) remote."
+
+                               if [ -n "${WANTED_NAME3}" -a "${REMOTE}" == "${WANTED_NAME3}" ]
+                               then
+                                       echo "$0: Project '${project}' has one correct '${WANTED_NAME3}'."
+                               else
+                                       echo "$0: Renaming '${REMOTE}' to '${WANTED_NAME3}' ..."
+                                       git remote rename "${REMOTE}" "${WANTED_NAME3}" || exit 255
+                               fi
+
+                               echo "$0: Adding '${GIT_ORIGIN}' to '${project}' ..."
+                               git remote add "${GIT_ORIGIN}" "${GIT_URL1}" --track "${GIT_BRANCH}" || exit 255
                        else
                                echo "$0: Unknown remote '${REMOTE_PUSH}' found. Exiting ..."
                                exit 1
@@ -132,8 +147,8 @@ for project in ${LIST}; do
                elif [ ! -d "${GIT_URL2}" ]
                then
                        echo "$0: Remote '${WANTED_NAME2}' cannot be created, path '${GIT_URL2}' missing."
-                       exit 1
-               else
+               elif [ -n "${WANTED_NAME2}" ]
+               then
                        echo "$0: No wanted '${WANTED_NAME2}' in '${project}'. Adding ..."
                        git remote add "${WANTED_NAME2}" "${GIT_URL2}" --track "${GIT_BRANCH}" || exit 255
                fi
@@ -144,12 +159,12 @@ for project in ${LIST}; do
                elif [ ! -d "${GIT_URL3}" ]
                then
                        echo "$0: Remote '${WANTED_NAME3}' cannot be created, path '${GIT_URL3}' missing."
-                       exit 1
                else
                        echo "$0: No wanted '${WANTED_NAME3}' in '${project}'. Adding ..."
                        git remote add "${WANTED_NAME3}" "${GIT_URL3}" --track "${GIT_BRANCH}" || exit 255
                fi
        fi
-
-       cd -
 done
+
+echo "$0: All done."
+exit 0
index a0bd4e9dc328812291792f1b098fc44cd92eb020..cd5cd1c8dddab252b4c164cbd09ae185829f4de4 100755 (executable)
@@ -17,18 +17,12 @@ for project in ${LIST}; do
                git checkout -- .
        fi
 
-       SKIP_TEST="${project:0:9}"
-
        echo "$0: Pulling '${project}' ..."
-       if [ "${SKIP_TEST}" = "jratecalc" ]
+
+       git pull transport master
+       if [ "$?" != "0" ]
        then
                git pull --all || exit 255
-       else
-               git pull transport master
-               if [ "$?" != "0" ]
-               then
-                       git pull --all || exit 255
-               fi
        fi
 
        if [ "$1" != "s" ]
index 2c6f5209b4f4e448f26c69c442febd15ec77d4ef..1e0b4b58712994bbe947d2ddf7376f8856a8ee08 100755 (executable)
@@ -26,19 +26,7 @@ for project in ${LIST}; do
        echo "$0: Processing '${project}',mode='$1' ..."
        cd "${JPROJECTS_HOME}/${project}" || exit 255
 
-       SKIP_TEST="${project:0:9}"
-
-       if [ -z "$2" -o "${SKIP_TEST}" = "jratecalc" ]
-       then
-               echo "$0: Pushing '${project}',mode='$1' ..."
-               git push --all || exit 255
-       fi
-
-       if [ "${SKIP_TEST}" = "jratecalc" ]
-       then
-               echo "$0: Not continuing for jratecalc project '${project}'."
-               continue
-       elif [ "$1" = "d" ]
+       if [ "$1" = "d" ]
        then
                git push --all daedalus || exit 255
        elif [ "$1" = "t" ]
@@ -47,7 +35,10 @@ for project in ${LIST}; do
        elif [ "$1" = "u" ]
        then
                git push --all upstream || exit 255
+       else
+               git push --all || exit 255
        fi
-
-       cd "${JPROJECTS_HOME}"
 done
+
+echo "$0: All done."
+exit 0