2020-07-15 04:30:58 +03:00
|
|
|
function _tide_sub_bug-report
|
2021-03-02 20:46:40 +03:00
|
|
|
argparse c/clean v/verbose -- $argv
|
2020-09-03 21:49:37 +03:00
|
|
|
|
2021-02-03 23:57:13 +03:00
|
|
|
if set -q _flag_clean
|
|
|
|
HOME=(mktemp -d) fish --init-command "curl --silent \
|
|
|
|
https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish |
|
|
|
|
source && fisher install ilancosman/tide"
|
|
|
|
else if set -q _flag_verbose
|
2021-03-30 23:53:41 +03:00
|
|
|
printf '%s\n' $TERM
|
2021-03-31 00:01:51 +03:00
|
|
|
|
2021-03-08 22:07:47 +03:00
|
|
|
set --long | string match --regex "^_?tide.*" | # Get only tide variables
|
|
|
|
string match --regex --invert "^_tide_.*_prompt_display_.*" | # Remove _tide_left_prompt_display_5770 etc
|
|
|
|
string match --regex --invert "^_tide_var_list.*" # Remove _tide_var_list
|
2021-02-03 23:57:13 +03:00
|
|
|
else
|
2021-03-30 23:53:41 +03:00
|
|
|
set -l currentFishVersion (fish --version | string match --regex "fish, version (\d\.\d\.\d)")[2]
|
2021-04-13 02:48:01 +03:00
|
|
|
_tide_check_version Fish fish-shell/fish-shell "(\d\.\d\.\d)" $currentFishVersion
|
2021-03-30 23:53:41 +03:00
|
|
|
|
|
|
|
set -l currentTideVersion (tide --version | string match --regex "tide, version (\d\.\d\.\d)")[2]
|
2021-04-13 02:48:01 +03:00
|
|
|
_tide_check_version Tide IlanCosman/tide "v(\d\.\d\.\d)" $currentTideVersion
|
|
|
|
|
|
|
|
# Check that omf is not installed
|
|
|
|
printf '%s' "Not using oh-my-fish... "
|
|
|
|
functions --query omf
|
|
|
|
_tide_check_condition \
|
|
|
|
"Tide does not work with oh-my-fish installed." \
|
|
|
|
"Please uninstall it before submitting a bug report."
|
2020-06-07 04:43:37 +03:00
|
|
|
end
|
2021-03-02 20:46:40 +03:00
|
|
|
end
|
2021-03-30 23:53:41 +03:00
|
|
|
|
|
|
|
function _tide_check_version -a programName repoName regexToGetVersion currentVersion
|
2021-03-31 01:29:21 +03:00
|
|
|
printf '%s' "Using latest version of $programName... "
|
|
|
|
|
2021-03-30 23:53:41 +03:00
|
|
|
curl --silent https://github.com/$repoName/releases/latest |
|
|
|
|
string match --regex ".*$repoName/releases/tag/$regexToGetVersion.*" |
|
|
|
|
read --local --line __ latestVersion
|
|
|
|
|
2021-04-13 02:48:01 +03:00
|
|
|
string match --quiet --regex "^$latestVersion" "$currentVersion"
|
|
|
|
_tide_check_condition \
|
|
|
|
"Your $programName version is out of date." \
|
|
|
|
"The latest is $latestVersion. You have $currentVersion." \
|
|
|
|
"Please update before submitting a bug report."
|
|
|
|
end
|
|
|
|
|
|
|
|
function _tide_check_condition
|
|
|
|
set -l returnStatus $status
|
|
|
|
|
|
|
|
if test "$returnStatus" = 0
|
2021-03-31 01:29:21 +03:00
|
|
|
set_color brgreen
|
|
|
|
printf '%s\n' $tide_status_success_icon
|
|
|
|
else
|
|
|
|
set_color red
|
2021-04-13 02:48:01 +03:00
|
|
|
printf '%s\n' $tide_status_failure_icon $argv
|
2021-03-31 01:29:21 +03:00
|
|
|
end
|
2021-04-13 02:48:01 +03:00
|
|
|
|
|
|
|
set_color normal
|
|
|
|
return $returnStatus
|
2021-03-30 23:53:41 +03:00
|
|
|
end
|