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
8b2b0ac5
Commit
8b2b0ac5
authored
Nov 23, 2014
by
Justin Hileman
Committed by
Bruno Pinto
Nov 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[bobthefish] Use brackets instead of test.
parent
3620d706
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 deletions
+19
-21
themes/bobthefish/fish_prompt.fish
themes/bobthefish/fish_prompt.fish
+19
-21
No files found.
themes/bobthefish/fish_prompt.fish
View file @
8b2b0ac5
...
...
@@ -139,7 +139,7 @@ function __bobthefish_start_segment -d 'Start a prompt segment'
end
function __bobthefish_path_segment -d 'Display a shortened form of a directory'
if
test -w "$argv[1]"
if
[ -w "$argv[1]" ]
__bobthefish_start_segment $__bobthefish_dk_grey $__bobthefish_med_grey
else
__bobthefish_start_segment $__bobthefish_dk_red $__bobthefish_lt_red
...
...
@@ -159,7 +159,7 @@ function __bobthefish_path_segment -d 'Display a shortened form of a directory'
set directory (basename "$argv[1]")
end
test "$parent"
; and echo -n -s "$parent"
[ "$parent" ]
; and echo -n -s "$parent"
set_color fff --bold
echo -n "$directory "
set_color normal
...
...
@@ -203,7 +203,7 @@ function __bobthefish_prompt_status -d 'Display symbols for a non zero exit stat
set -l status_flags "$nonzero$superuser$bg_jobs"
if
test "$nonzero" -o "$superuser" -o "$bg_jobs"
if
[ "$nonzero" -o "$superuser" -o "$bg_jobs" ]
__bobthefish_start_segment fff 000
if [ "$nonzero" ]
set_color $__bobthefish_med_red --bold
...
...
@@ -237,11 +237,11 @@ function __bobthefish_prompt_hg -d 'Display the actual hg state'
set -l dirty (command hg stat; or echo -n '*')
set -l flags "$dirty"
test "$flags"
; and set flags ""
[ "$flags" ]
; and set flags ""
set -l flag_bg $__bobthefish_lt_green
set -l flag_fg $__bobthefish_dk_green
if
test "$dirty"
if
[ "$dirty" ]
set flag_bg $__bobthefish_med_red
set flag_fg fff
end
...
...
@@ -256,8 +256,8 @@ function __bobthefish_prompt_hg -d 'Display the actual hg state'
set_color normal
set -l project_pwd (__bobthefish_project_pwd $argv[1])
if
test "$project_pwd"
if
test -w "$PWD"
if
[ "$project_pwd" ]
if
[ -w "$PWD" ]
__bobthefish_start_segment 333 999
else
__bobthefish_start_segment $__bobthefish_med_red $__bobthefish_lt_red
...
...
@@ -274,21 +274,19 @@ function __bobthefish_prompt_git -d 'Display the actual git state'
set -l ahead (command git rev-list --left-right '@{upstream}...HEAD' ^/dev/null | awk '/>/ {a += 1} /</ {b += 1} {if (a > 0) nextfile} END {if (a > 0 && b > 0) print "±"; else if (a > 0) print "+"; else if (b > 0) print "-"}')
set -l new (command git ls-files --other --exclude-standard);
test "$new"
; and set new '…'
[ "$new" ]
; and set new '…'
set -l flags "$dirty$staged$stashed$ahead$new"
test "$flags"
; and set flags " $flags"
[ "$flags" ]
; and set flags " $flags"
set -l flag_bg $__bobthefish_lt_green
set -l flag_fg $__bobthefish_dk_green
if
test "$dirty" -o "$staged"
if
[ "$dirty" -o "$staged" ]
set flag_bg $__bobthefish_med_red
set flag_fg fff
else
if test "$stashed"
set flag_bg $__bobthefish_lt_orange
set flag_fg $__bobthefish_dk_orange
end
else if [ "$stashed" ]
set flag_bg $__bobthefish_lt_orange
set flag_fg $__bobthefish_dk_orange
end
__bobthefish_path_segment $argv[1]
...
...
@@ -298,8 +296,8 @@ function __bobthefish_prompt_git -d 'Display the actual git state'
set_color normal
set -l project_pwd (__bobthefish_project_pwd $argv[1])
if
test "$project_pwd"
if
test -w "$PWD"
if
[ "$project_pwd" ]
if
[ -w "$PWD" ]
__bobthefish_start_segment 333 999
else
__bobthefish_start_segment $__bobthefish_med_red $__bobthefish_lt_red
...
...
@@ -328,7 +326,7 @@ end
function __bobthefish_prompt_virtualfish -d "Display activated virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself)"
set -q VIRTUAL_ENV; or return
set -l version_glyph (__bobthefish_virtualenv_python_version)
if
test "$version_glyph"
if
[ "$version_glyph" ]
__bobthefish_start_segment $__bobthefish_med_blue $__bobthefish_lt_grey
echo -n -s $__bobthefish_virtualenv_glyph $version_glyph
end
...
...
@@ -346,7 +344,7 @@ function __bobthefish_prompt_rubies -d 'Display current Ruby (rvm/rbenv)'
# Don't show global ruby version...
[ "$ruby_version" = (rbenv global) ]; and return
end
test -w "$ruby_version"
; and return
[ -w "$ruby_version" ]
; and return
__bobthefish_start_segment $__bobthefish_ruby_red $__bobthefish_lt_grey --bold
echo -n -s $ruby_version ' '
...
...
@@ -366,9 +364,9 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'
set -l git_root (__bobthefish_git_project_dir)
set -l hg_root (__bobthefish_hg_project_dir)
if
test (echo "$hg_root" | wc -c) -gt (echo "$git_root" | wc -c)
if
[ (echo "$hg_root" | wc -c) -gt (echo "$git_root" | wc -c) ]
__bobthefish_prompt_hg $hg_root
else if
test "$git_root"
else if
[ "$git_root" ]
__bobthefish_prompt_git $git_root
else
__bobthefish_prompt_dir
...
...
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