Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
c84ae81a
You need to sign in or sign up before continuing.
Commit
c84ae81a
authored
Nov 17, 2014
by
Justin Hileman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[bobthefish] DRY: we don't need two pwd-relative-to-project funcs
parent
eecb144e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
themes/bobthefish/fish_prompt.fish
themes/bobthefish/fish_prompt.fish
+3
-10
No files found.
themes/bobthefish/fish_prompt.fish
View file @
c84ae81a
...
...
@@ -104,16 +104,9 @@ function __bobthefish_project_dir_hg -d 'Print the current git project base dire
end
function __bobthefish_project_pwd -d 'Print the working directory relative to project root'
set -l base_dir (__bobthefish_project_dir)
echo "$PWD" | sed -e "s*$base_dir**g" -e 's*^/**'
echo "$PWD" | sed -e "s*$argv[1]**g" -e 's*^/**'
end
function __bobthefish_project_pwd_hg -d 'Print the working directory relative to project root'
set -l base_dir (__bobthefish_project_dir_hg)
echo "$PWD" | sed -e "s*$base_dir**g" -e 's*^/**'
end
# ===========================
# Segment functions
...
...
@@ -258,7 +251,7 @@ function __bobthefish_prompt_hg -d 'Display the actual hg state'
echo -n -s (__bobthefish_hg_branch) $flags ' '
set_color normal
set -l project_pwd (__bobthefish_project_pwd
_hg
)
set -l project_pwd (__bobthefish_project_pwd
(__bobthefish_project_dir_hg)
)
if test "$project_pwd"
if test -w "$PWD"
__bobthefish_start_segment 333 999
...
...
@@ -302,7 +295,7 @@ function __bobthefish_prompt_git -d 'Display the actual git state'
echo -n -s (__bobthefish_git_branch) $flags ' '
set_color normal
set -l project_pwd (__bobthefish_project_pwd)
set -l project_pwd (__bobthefish_project_pwd
(__bobthefish_project_dir)
)
if test "$project_pwd"
if test -w "$PWD"
__bobthefish_start_segment 333 999
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment