Modified the update check in update.sh to fetch the newest revision directly from github without having to run git fetch first.
parent
d6b4f2836f
commit
adf9daa9b7
|
@ -62,8 +62,12 @@ while (($#)); do
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
--check|-c)
|
--check|-c)
|
||||||
echo "Checking remote code for updates..."
|
echo "Checking remote code for updates..."
|
||||||
git fetch origin #${BRANCH}
|
LATEST_REV=$(git ls-remote --exit-code --refs --quiet https://github.com/mailcow/mailcow-dockerized ${BRANCH} | cut -f1)
|
||||||
if [[ -z $(git log HEAD --pretty=format:"%H" | grep $(git rev-parse origin/${BRANCH})) ]]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "A problem occurred while trying to fetch the latest revision from github."
|
||||||
|
exit 99
|
||||||
|
fi
|
||||||
|
if [[ -z $(git log HEAD --pretty=format:"%H" | grep "${LATEST_REV}") ]]; then
|
||||||
echo "Updated code is available."
|
echo "Updated code is available."
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue