Merge remote-tracking branch 'origin/v1.6' into dev

This commit is contained in:
rootzoll 2020-09-10 16:15:56 +02:00
commit 7cb4027714
3 changed files with 29 additions and 10 deletions

View File

@ -2,7 +2,7 @@
*Build your own Lightning Node on a RaspberryPi with a nice Display.*
`Version 1.6 with lnd 0.10.4 and bitcoin 0.20.1 (or litecoin 0.18.1)`
`Version 1.6 with lnd 0.10.4 and bitcoin 0.20.0 (or litecoin 0.18.1)`
![RaspiBlitz](pictures/raspiblitz.jpg)

View File

@ -125,10 +125,11 @@ patch()
# Patch Options
OPTIONS=(PATCH "Patch/Sync RaspiBlitz with GitHub Repo" \
REPO "Change GitHub Repo to sync with" \
BRANCH "Change GitHub Branch to sync with"
BRANCH "Change GitHub Branch to sync with" \
PR "Checkout a PullRequest to test"
)
CHOICE=$(whiptail --clear --title "GitHub-User: ${activeGitHubUser} Branch: ${activeBranch}" --menu "" 10 55 3 "${OPTIONS[@]}" 2>&1 >/dev/tty)
CHOICE=$(whiptail --clear --title "GitHub-User: ${activeGitHubUser} Branch: ${activeBranch}" --menu "" 11 55 4 "${OPTIONS[@]}" 2>&1 >/dev/tty)
clear
case $CHOICE in
@ -185,6 +186,24 @@ patch()
patch
exit 1
;;
PR)
clear
echo "..."
pullRequestID=$(whiptail --inputbox "\nPlease enter the NUMBER of the PullRequest on RaspiBlitz Repo '${activeGitHubUser}'?" 10 46 --title "Checkout PullRequest ID" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
pullRequestID=$(echo "${pullRequestID}" | cut -d " " -f1)
echo "--> " $pullRequestID
cd /home/admin/raspiblitz
git fetch origin pull/${pullRequestID}/head:${pullRequestID}pr
error=""
source <(sudo -u admin /home/admin/XXsyncScripts.sh ${pullRequestID}pr)
if [ ${#error} -gt 0 ]; then
whiptail --title "ERROR" --msgbox "${error}" 8 30
fi
fi
exit 1
;;
esac
}

View File

@ -83,17 +83,17 @@ if [ ${#wantedBranch} -gt 0 ]; then
echo "# OK"
else
echo "# checking branch exists .."
branchExists=$(curl -s https://api.github.com/repos/${activeGitHubUser}/raspiblitz/branches/${wantedBranch} | jq -r '.name' | grep -c ${wantedBranch})
if [ ${branchExists} -eq 0 ]; then
echo "error='branch not found'"
exit 1
fi
echo "# checking if branch is locally available"
localBranch=$(git branch | grep -c "${wantedBranch}")
if [ ${localBranch} -eq 0 ]; then
echo "# checking branch exists .."
branchExists=$(curl -s https://api.github.com/repos/${activeGitHubUser}/raspiblitz/branches/${wantedBranch} | jq -r '.name' | grep -c ${wantedBranch})
if [ ${branchExists} -eq 0 ]; then
echo "error='branch not found'"
exit 1
fi
echo "# checkout/changing branch .."
git fetch
git checkout -b ${wantedBranch} origin/${wantedBranch}
else
echo "# changing branch .."