mirror of
https://github.com/IlanCosman/tide.git
synced 2024-10-26 18:51:05 +03:00
give feedback when checking versions
This commit is contained in:
parent
615c9c75b0
commit
52be745319
@ -21,17 +21,24 @@ function _tide_sub_bug-report
|
|||||||
end
|
end
|
||||||
|
|
||||||
function _tide_check_version -a programName repoName regexToGetVersion currentVersion
|
function _tide_check_version -a programName repoName regexToGetVersion currentVersion
|
||||||
|
printf '%s' "Using latest version of $programName... "
|
||||||
|
|
||||||
curl --silent https://github.com/$repoName/releases/latest |
|
curl --silent https://github.com/$repoName/releases/latest |
|
||||||
string match --regex ".*$repoName/releases/tag/$regexToGetVersion.*" |
|
string match --regex ".*$repoName/releases/tag/$regexToGetVersion.*" |
|
||||||
read --local --line __ latestVersion
|
read --local --line __ latestVersion
|
||||||
|
|
||||||
string match --quiet --regex "^$latestVersion" "$currentVersion" && return
|
if string match --quiet --regex "^$latestVersion" "$currentVersion"
|
||||||
|
set_color brgreen
|
||||||
set_color red
|
printf '%s\n' $tide_status_success_icon
|
||||||
printf '%s\n' \
|
set_color normal
|
||||||
"Your $programName version is out of date." \
|
return 0
|
||||||
"The latest is $latestVersion. You have $currentVersion." \
|
else
|
||||||
"Please update before submitting a bug report."
|
set_color red
|
||||||
set_color normal
|
printf '%s\n' $tide_status_failure_icon \
|
||||||
return 1
|
"Your $programName version is out of date." \
|
||||||
|
"The latest is $latestVersion. You have $currentVersion." \
|
||||||
|
"Please update before submitting a bug report."
|
||||||
|
set_color normal
|
||||||
|
return 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user