mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2026-09-30 00:34:42 +00:00
speed up rvm prompt
This commit is contained in:
+5
-7
@@ -1393,13 +1393,11 @@ prompt_rspec_stats() {
|
|||||||
################################################################
|
################################################################
|
||||||
# Segment to display Ruby Version Manager information
|
# Segment to display Ruby Version Manager information
|
||||||
prompt_rvm() {
|
prompt_rvm() {
|
||||||
if [ $commands[rvm-prompt] ]; then
|
(( $+commands[rvm-prompt] )) || return
|
||||||
local version_and_gemset=${$(rvm-prompt v p)/ruby-}
|
[[ $GEM_HOME == *rvm* && $ruby_string != $rvm_path/bin/ruby ]] || return
|
||||||
|
local v=${${${GEM_HOME:t}%%${rvm_gemset_separator:-@}*}#*-}
|
||||||
if [[ -n "$version_and_gemset" ]]; then
|
[[ -n $v ]] || return
|
||||||
"$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" 'RUBY_ICON' 0 '' "${${version_and_gemset//\%/%%}//\\/\\\\}"
|
"$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" 'RUBY_ICON' 0 '' "${${v//\%/%%}//\\/\\\\}"
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user