mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2024-10-27 20:34:23 +00:00
string trim
appears to be a hair faster than regex.
This commit is contained in:
parent
61325754bb
commit
c68498fc79
@ -723,7 +723,7 @@ function __bobthefish_prompt_git -S -a current_dir -d 'Display the actual git st
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l project_pwd (command git rev-parse --show-prefix ^/dev/null | string replace -r '/$' '')
|
set -l project_pwd (command git rev-parse --show-prefix ^/dev/null | string trim --right --chars=/)
|
||||||
set -l work_dir (command git rev-parse --show-toplevel ^/dev/null)
|
set -l work_dir (command git rev-parse --show-toplevel ^/dev/null)
|
||||||
|
|
||||||
# only show work dir if it's a parent…
|
# only show work dir if it's a parent…
|
||||||
@ -765,7 +765,7 @@ function __bobthefish_prompt_git -S -a current_dir -d 'Display the actual git st
|
|||||||
set project_pwd $PWD
|
set project_pwd $PWD
|
||||||
string match "$current_dir*" $project_pwd >/dev/null
|
string match "$current_dir*" $project_pwd >/dev/null
|
||||||
and set project_pwd (string sub -s (math 1 + (string length $current_dir)) $project_pwd)
|
and set project_pwd (string sub -s (math 1 + (string length $current_dir)) $project_pwd)
|
||||||
set project_pwd (string replace -r '^/' '' $project_pwd)
|
set project_pwd (string trim --left --chars=/ -- $project_pwd)
|
||||||
|
|
||||||
if [ "$project_pwd" ]
|
if [ "$project_pwd" ]
|
||||||
set -l colors $__color_path
|
set -l colors $__color_path
|
||||||
|
Loading…
Reference in New Issue
Block a user