mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-27 12:06:36 +02:00
add commit has info to github menu (#2674)
This commit is contained in:
@@ -127,7 +127,7 @@ patch()
|
|||||||
PR "Checkout a PullRequest to test"
|
PR "Checkout a PullRequest to test"
|
||||||
)
|
)
|
||||||
|
|
||||||
CHOICE=$(whiptail --clear --title "GitHub-User: ${activeGitHubUser} Branch: ${activeBranch}" --menu "" 11 55 4 "${OPTIONS[@]}" 2>&1 >/dev/tty)
|
CHOICE=$(whiptail --clear --title " GitHub user:${activeGitHubUser} branch:${activeBranch} (${commitHashShort})" --menu "" 11 60 4 "${OPTIONS[@]}" 2>&1 >/dev/tty)
|
||||||
|
|
||||||
clear
|
clear
|
||||||
case $CHOICE in
|
case $CHOICE in
|
||||||
|
@@ -10,22 +10,28 @@
|
|||||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then
|
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then
|
||||||
echo "FOR DEVELOPMENT USE ONLY!"
|
echo "FOR DEVELOPMENT USE ONLY!"
|
||||||
echo "RaspiBlitz Sync Scripts"
|
echo "RaspiBlitz Sync Scripts"
|
||||||
echo "XXsyncScripts.sh info"
|
echo "blitz.github.sh info"
|
||||||
echo "XXsyncScripts.sh [-run|-clean|-install|-justinstall] branch [repo]"
|
echo "blitz.github.sh [-run|-clean|-install|-justinstall] branch [repo]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /home/admin/raspiblitz
|
|
||||||
source /mnt/hdd/raspiblitz.conf 2>/dev/null
|
source /mnt/hdd/raspiblitz.conf 2>/dev/null
|
||||||
|
|
||||||
|
cd /home/admin/raspiblitz
|
||||||
|
|
||||||
# gather info
|
# gather info
|
||||||
activeGitHubUser=$(sudo -u admin cat /home/admin/raspiblitz/.git/config 2>/dev/null | grep "url = " | cut -d "=" -f2 | cut -d "/" -f4)
|
activeGitHubUser=$(sudo -u admin cat /home/admin/raspiblitz/.git/config 2>/dev/null | grep "url = " | cut -d "=" -f2 | cut -d "/" -f4)
|
||||||
activeBranch=$(git branch 2>/dev/null | grep \* | cut -d ' ' -f2)
|
activeBranch=$(git branch 2>/dev/null | grep \* | cut -d ' ' -f2)
|
||||||
|
commitHashLong=$(git log -n1 --format=format:"%H")
|
||||||
|
commitHashShort=${commitHashLong:0:7}
|
||||||
|
|
||||||
# if parameter is "info" just give back basic info about sync
|
# if parameter is "info" just give back basic info about sync
|
||||||
if [ "$1" == "info" ]; then
|
if [ "$1" == "info" ]; then
|
||||||
|
|
||||||
echo "activeGitHubUser='${activeGitHubUser}'"
|
echo "activeGitHubUser='${activeGitHubUser}'"
|
||||||
echo "activeBranch='${activeBranch}'"
|
echo "activeBranch='${activeBranch}'"
|
||||||
|
echo "commitHashLong='${commitHashLong}'"
|
||||||
|
echo "commitHashShort='${commitHashShort}'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user