mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-11 05:13:13 +02:00
#1138 allow sync script to change repo
This commit is contained in:
@@ -23,17 +23,29 @@ fi
|
|||||||
# change branch if set as parameter
|
# change branch if set as parameter
|
||||||
clean=0
|
clean=0
|
||||||
wantedBranch="$1"
|
wantedBranch="$1"
|
||||||
|
wantedGitHubUser="$2"
|
||||||
if [ "${wantedBranch}" = "-clean" ]; then
|
if [ "${wantedBranch}" = "-clean" ]; then
|
||||||
clean=1
|
clean=1
|
||||||
wantedBranch="$2"
|
wantedBranch="$2"
|
||||||
|
wantedRepo="$3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set to another GutHub repo as origin
|
||||||
|
if [ ${#wantedGitHubUser} -gt 0 ]; then
|
||||||
|
echo "# your active GitHubUser is: ${activeGitHubUser}"
|
||||||
|
echo "# your wanted GitHubUser is: ${wantedGitHubUser}"
|
||||||
|
if [ "${activeGitHubUser}" = "${wantedGitHubUser}" ]; then
|
||||||
|
echo "# OK"
|
||||||
|
else
|
||||||
|
echo "# try changing github origin .."
|
||||||
|
git remote set-url origin https://github.com/${wantedGitHubUser}/raspiblitz.git
|
||||||
|
activeGitHubUser=$(sudo -u admin cat /home/admin/raspiblitz/.git/config | grep "url = " | cut -d "=" -f2 | cut -d "/" -f4)
|
||||||
fi
|
fi
|
||||||
if [ "$2" = "-clean" ]; then
|
|
||||||
clean=1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${#wantedBranch} -gt 0 ]; then
|
if [ ${#wantedBranch} -gt 0 ]; then
|
||||||
echo "# your wanted branch is: ${wantedBranch}"
|
|
||||||
echo "# your active branch is: ${activeBranch}"
|
echo "# your active branch is: ${activeBranch}"
|
||||||
|
echo "# your wanted branch is: ${wantedBranch}"
|
||||||
if [ "${wantedBranch}" = "${activeBranch}" ]; then
|
if [ "${wantedBranch}" = "${activeBranch}" ]; then
|
||||||
echo "# OK"
|
echo "# OK"
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user