mirror of
https://github.com/IlanCosman/tide.git
synced 2024-12-22 19:41:36 +03:00
add node item (#181)
* add node * Use string trim instead Co-authored-by: Ilan Cosman <ilancosman@gmail.com>
This commit is contained in:
parent
79e8e40c84
commit
4f1002c3df
3
functions/_tide_item_node.fish
Normal file
3
functions/_tide_item_node.fish
Normal file
@ -0,0 +1,3 @@
|
||||
function _tide_item_node
|
||||
test -e package.json && _tide_print_item node $tide_node_icon' ' (node --version | string trim --chars=v)
|
||||
end
|
@ -1,6 +1,6 @@
|
||||
function _tide_remove_unusable_items
|
||||
# Remove tool-specific items for tools the machine doesn't have installed
|
||||
for item in chruby git go kubectl nvm php rustc virtual_env
|
||||
for item in chruby git go kubectl node nvm php rustc virtual_env
|
||||
set -l cli_names $item
|
||||
switch $item
|
||||
case virtual_env
|
||||
|
@ -45,6 +45,9 @@ tide_left_prompt_prefix ''
|
||||
tide_left_prompt_separator_diff_color ''
|
||||
tide_left_prompt_separator_same_color ''
|
||||
tide_left_prompt_suffix ''
|
||||
tide_node_bg_color 444444
|
||||
tide_node_color 44883E
|
||||
tide_node_icon '⬢'
|
||||
tide_nvm_bg_color 444444
|
||||
tide_nvm_color 44883E
|
||||
tide_nvm_icon '⬢'
|
||||
@ -68,7 +71,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 nvm virtual_env rustc php chruby go kubectl vi_mode
|
||||
tide_right_prompt_items status cmd_duration context jobs node nvm virtual_env rustc php chruby go kubectl vi_mode
|
||||
tide_right_prompt_prefix ''
|
||||
tide_right_prompt_separator_diff_color ''
|
||||
tide_right_prompt_separator_same_color ''
|
||||
|
@ -26,6 +26,8 @@ tide_jobs_bg_color black
|
||||
tide_jobs_color green
|
||||
tide_kubectl_bg_color black
|
||||
tide_kubectl_color blue
|
||||
tide_node_bg_color black
|
||||
tide_node_color green
|
||||
tide_nvm_bg_color black
|
||||
tide_nvm_color green
|
||||
tide_os_bg_color black
|
||||
|
@ -45,6 +45,9 @@ tide_left_prompt_prefix ''
|
||||
tide_left_prompt_separator_diff_color ' '
|
||||
tide_left_prompt_separator_same_color ' '
|
||||
tide_left_prompt_suffix ' '
|
||||
tide_node_bg_color normal
|
||||
tide_node_color 44883E
|
||||
tide_node_icon '⬢'
|
||||
tide_nvm_bg_color normal
|
||||
tide_nvm_color 44883E
|
||||
tide_nvm_icon '⬢'
|
||||
@ -68,7 +71,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 nvm virtual_env rustc php chruby go kubectl
|
||||
tide_right_prompt_items status cmd_duration context jobs node nvm virtual_env rustc php chruby go kubectl
|
||||
tide_right_prompt_prefix ' '
|
||||
tide_right_prompt_separator_diff_color ' '
|
||||
tide_right_prompt_separator_same_color ' '
|
||||
|
@ -26,6 +26,8 @@ tide_jobs_bg_color normal
|
||||
tide_jobs_color green
|
||||
tide_kubectl_bg_color normal
|
||||
tide_kubectl_color blue
|
||||
tide_node_bg_color normal
|
||||
tide_node_color green
|
||||
tide_nvm_bg_color normal
|
||||
tide_nvm_color green
|
||||
tide_os_bg_color normal
|
||||
|
@ -45,6 +45,9 @@ tide_left_prompt_prefix ''
|
||||
tide_left_prompt_separator_diff_color ''
|
||||
tide_left_prompt_separator_same_color ''
|
||||
tide_left_prompt_suffix ''
|
||||
tide_node_bg_color 44883E
|
||||
tide_node_color 000000
|
||||
tide_node_icon '⬢'
|
||||
tide_nvm_bg_color 44883E
|
||||
tide_nvm_color 000000
|
||||
tide_nvm_icon '⬢'
|
||||
@ -68,7 +71,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 nvm virtual_env rustc php chruby go kubectl vi_mode
|
||||
tide_right_prompt_items status cmd_duration context jobs node nvm virtual_env rustc php chruby go kubectl vi_mode
|
||||
tide_right_prompt_prefix ''
|
||||
tide_right_prompt_separator_diff_color ''
|
||||
tide_right_prompt_separator_same_color ''
|
||||
|
@ -26,6 +26,8 @@ tide_jobs_bg_color brblack
|
||||
tide_jobs_color green
|
||||
tide_kubectl_bg_color blue
|
||||
tide_kubectl_color black
|
||||
tide_node_bg_color green
|
||||
tide_node_color black
|
||||
tide_nvm_bg_color green
|
||||
tide_nvm_color black
|
||||
tide_os_bg_color white
|
||||
|
18
tests/_tide_item_node.test.fish
Normal file
18
tests/_tide_item_node.test.fish
Normal file
@ -0,0 +1,18 @@
|
||||
# RUN: %fish %s
|
||||
|
||||
function _node
|
||||
_tide_decolor (_tide_item_node)
|
||||
end
|
||||
|
||||
set -l tmpdir (mktemp -d)
|
||||
cd $tmpdir
|
||||
|
||||
mock node --version "echo v16.5.0"
|
||||
set -lx tide_node_icon ⬢
|
||||
|
||||
_node # CHECK:
|
||||
|
||||
touch package.json
|
||||
_node # CHECK: ⬢ 16.5.0
|
||||
|
||||
rm -r $tmpdir
|
Loading…
Reference in New Issue
Block a user