Merge java item (#244)

This commit is contained in:
Ilan Cosman 2022-01-09 13:14:55 -08:00
commit 05658ae43d
9 changed files with 43 additions and 4 deletions

View File

@ -0,0 +1,3 @@
function _tide_item_java
test -e pom.xml && _tide_print_item java $tide_java_icon' ' (java --version | string split ' ')[2]
end

View File

@ -1,7 +1,7 @@
function _tide_remove_unusable_items
# Remove tool-specific items for tools the machine doesn't have installed
set -l removed_items
for item in chruby docker git go kubectl node php rustc terraform toolbox virtual_env
for item in chruby docker git go java kubectl node php rustc terraform toolbox virtual_env
set -l cli_names $item
switch $item
case virtual_env

View File

@ -36,6 +36,9 @@ tide_git_truncation_length 24
tide_go_bg_color 444444
tide_go_color 00ACD7
tide_go_icon
tide_java_bg_color 444444
tide_java_color ED8B00
tide_java_icon ''
tide_jobs_bg_color 444444
tide_jobs_color $_tide_color_dark_green
tide_jobs_icon
@ -75,7 +78,7 @@ tide_pwd_icon_home
tide_pwd_icon_unwritable
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
tide_right_prompt_frame_enabled true
tide_right_prompt_items status cmd_duration context jobs node virtual_env rustc php chruby go kubectl toolbox terraform vi_mode
tide_right_prompt_items status cmd_duration context jobs node virtual_env rustc java php chruby go kubectl toolbox terraform vi_mode
tide_right_prompt_prefix
tide_right_prompt_separator_diff_color
tide_right_prompt_separator_same_color

View File

@ -23,6 +23,8 @@ tide_git_color_untracked brblue
tide_git_color_upstream brgreen
tide_go_bg_color black
tide_go_color brcyan
tide_java_bg_color black
tide_java_color yellow
tide_jobs_bg_color black
tide_jobs_color green
tide_kubectl_bg_color black

View File

@ -36,6 +36,9 @@ tide_git_truncation_length 24
tide_go_bg_color normal
tide_go_color 00ACD7
tide_go_icon
tide_java_bg_color normal
tide_java_color ED8B00
tide_java_icon ''
tide_jobs_bg_color normal
tide_jobs_color $_tide_color_dark_green
tide_jobs_icon
@ -75,7 +78,7 @@ tide_pwd_icon_home
tide_pwd_icon_unwritable
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
tide_right_prompt_frame_enabled false
tide_right_prompt_items status cmd_duration context jobs node virtual_env rustc php chruby go kubectl toolbox terraform
tide_right_prompt_items status cmd_duration context jobs node virtual_env rustc java php chruby go kubectl toolbox terraform
tide_right_prompt_prefix ' '
tide_right_prompt_separator_diff_color ' '
tide_right_prompt_separator_same_color ' '

View File

@ -23,6 +23,8 @@ tide_git_color_untracked brblue
tide_git_color_upstream brgreen
tide_go_bg_color normal
tide_go_color brcyan
tide_java_bg_color normal
tide_java_color yellow
tide_jobs_bg_color normal
tide_jobs_color green
tide_kubectl_bg_color normal

View File

@ -36,6 +36,9 @@ tide_git_truncation_length 24
tide_go_bg_color 00ACD7
tide_go_color 000000
tide_go_icon
tide_java_bg_color ED8B00
tide_java_color 000000
tide_java_icon ''
tide_jobs_bg_color 444444
tide_jobs_color 4E9A06
tide_jobs_icon
@ -75,7 +78,7 @@ tide_pwd_icon_home
tide_pwd_icon_unwritable
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
tide_right_prompt_frame_enabled true
tide_right_prompt_items status cmd_duration context jobs node virtual_env rustc php chruby go kubectl toolbox terraform vi_mode
tide_right_prompt_items status cmd_duration context jobs node virtual_env rustc java php chruby go kubectl toolbox terraform vi_mode
tide_right_prompt_prefix
tide_right_prompt_separator_diff_color
tide_right_prompt_separator_same_color

View File

@ -23,6 +23,8 @@ tide_git_color_untracked black
tide_git_color_upstream black
tide_go_bg_color brcyan
tide_go_color black
tide_java_bg_color yellow
tide_java_color black
tide_jobs_bg_color brblack
tide_jobs_color green
tide_kubectl_bg_color blue

View File

@ -0,0 +1,21 @@
# RUN: %fish %s
function _java
_tide_decolor (_tide_item_java)
end
set -l javaDir (mktemp -d)
cd $javaDir
mock java --version "echo 'openjdk 17.0.1 2021-10-19
OpenJDK Runtime Environment (build 17.0.1+12)
OpenJDK 64-Bit Server VM (build 17.0.1+12, mixed mode)'"
set -lx tide_java_icon
_java # CHECK:
touch pom.xml
_java # CHECK:  17.0.1
rm -r $javaDir