mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2024-11-19 09:50:19 +01:00
add commit has info to github menu (#2674)
This commit is contained in:
parent
c681428740
commit
2c26fe40f4
@ -127,7 +127,7 @@ patch()
|
||||
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
|
||||
case $CHOICE in
|
||||
|
@ -10,22 +10,28 @@
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then
|
||||
echo "FOR DEVELOPMENT USE ONLY!"
|
||||
echo "RaspiBlitz Sync Scripts"
|
||||
echo "XXsyncScripts.sh info"
|
||||
echo "XXsyncScripts.sh [-run|-clean|-install|-justinstall] branch [repo]"
|
||||
echo "blitz.github.sh info"
|
||||
echo "blitz.github.sh [-run|-clean|-install|-justinstall] branch [repo]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd /home/admin/raspiblitz
|
||||
source /mnt/hdd/raspiblitz.conf 2>/dev/null
|
||||
|
||||
cd /home/admin/raspiblitz
|
||||
|
||||
# gather info
|
||||
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)
|
||||
commitHashLong=$(git log -n1 --format=format:"%H")
|
||||
commitHashShort=${commitHashLong:0:7}
|
||||
|
||||
# if parameter is "info" just give back basic info about sync
|
||||
if [ "$1" == "info" ]; then
|
||||
|
||||
echo "activeGitHubUser='${activeGitHubUser}'"
|
||||
echo "activeBranch='${activeBranch}'"
|
||||
echo "commitHashLong='${commitHashLong}'"
|
||||
echo "commitHashShort='${commitHashShort}'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user