Merge pull request #244 from epmoyer/escape_regex

Escape project_root_dir before using it in regex
feature/pretty-pipenv
Justin Hileman 4 years ago committed by GitHub
commit 9032cf426b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -231,7 +231,8 @@ function __bobthefish_project_pwd -S -a project_root_dir -a real_pwd -d 'Print t
set -q theme_project_dir_length
or set -l theme_project_dir_length 0
set -l project_dir (string replace -r '^'"$project_root_dir"'($|/)' '' $real_pwd)
set -l project_root_dir_escaped (string escape --style=regex $project_root_dir)
set -l project_dir (string replace -r '^'"$project_root_dir_escaped"'($|/)' '' $real_pwd)
if [ $theme_project_dir_length -eq 0 ]
echo -n $project_dir

Loading…
Cancel
Save