diff --git a/github/check.gitea.update b/github/check.gitea.update index b76cd2b..9de5a50 100755 --- a/github/check.gitea.update +++ b/github/check.gitea.update @@ -46,7 +46,7 @@ DEBUG=1 script_wd=$(dirname "${0}") gitea_repo_url="https://github.com/go-gitea/gitea" -gitea_new_version=$("${script_wd}"/releasetags "${gitea_repo_url}" | grep -vE -- '(dev|rc)' | head -n1 | sed 's/v//') +gitea_new_version=$("${script_wd}"/releasetags "${gitea_repo_url}" | grep --invert-match --extended-regexp -- '(dev|rc)' | head --lines=1 | sed 's/v//') gitea_new_version_file="/tmp/.github.gitea.upgrade" @@ -61,7 +61,7 @@ else gitea_bin_path="gitea" fi -gitea_current_version=$("${gitea_bin_path}" -v | cut -d' ' -f3) +gitea_current_version=$("${gitea_bin_path}" --version | cut --delimiter=' ' --fields=3) # }}} @@ -84,7 +84,7 @@ if [ "${gitea_current_version}" != "${gitea_new_version}" ]; then else [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test version — The current version is up-to-date." - rm -f -- "${gitea_new_version_file}" + rm --force -- "${gitea_new_version_file}" fi # }}}