Skip to content

Commit

Permalink
improve updatecheck (#108)
Browse files Browse the repository at this point in the history
* improve grep

* fix get_local_branch
  • Loading branch information
ipitio authored Apr 16, 2024
1 parent 30228af commit 84d3dc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions advanced/Scripts/updatecheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
function get_local_branch() {
# Return active branch
cd "${1}" 2> /dev/null || return 1
git rev-parse --abbrev-ref HEAD || return 1
local foundBranch=$(git show-ref --heads | grep "$(git rev-parse HEAD)" | awk '{print $2;}' | cut -d '/' -f 3)
echo "${foundBranch:-HEAD}"
}

function get_local_version() {
Expand All @@ -36,7 +37,6 @@ function get_remote_version() {
fi
}


function get_remote_hash(){
git ls-remote "https://github.com/arevindh/${1}" --tags "${2}" | awk '{print substr($0, 0,8);}' || { git ls-remote "https://github.com/pi-hole/${1}" --tags "${2}" | awk '{print substr($0, 0,8);}' || return 1; }
}
Expand Down

0 comments on commit 84d3dc3

Please sign in to comment.