mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-27 14:45:13 +08:00
Remove a few calls to the test command in favour of the switch builtin to speed statup up
darcs-hash:20070922190734-75c98-0e63a0ed6685edc2c9aa941f0b26c14466c7af6a.gz
This commit is contained in:
parent
1420744669
commit
5ecd0e22bf
@ -83,7 +83,11 @@ function __fish_config_interactive -d "Initializations that should be performed
|
|||||||
set -U fish_greeting $line1\n$line2
|
set -U fish_greeting $line1\n$line2
|
||||||
end
|
end
|
||||||
|
|
||||||
if test "$fish_greeting"
|
switch $fish_greeting
|
||||||
|
case ''
|
||||||
|
# If variable is empty, don't print anything, saves us a fork
|
||||||
|
|
||||||
|
case '*'
|
||||||
echo $fish_greeting
|
echo $fish_greeting
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -3,12 +3,16 @@
|
|||||||
# Also drop '/private' directories on OS X.
|
# Also drop '/private' directories on OS X.
|
||||||
#
|
#
|
||||||
|
|
||||||
if test (uname) = Darwin
|
switch (uname)
|
||||||
|
|
||||||
|
case Darwin
|
||||||
function pwd --description "Print working directory"
|
function pwd --description "Print working directory"
|
||||||
echo $PWD | sed -e 's|/private||' -e "s|^$HOME|~|"
|
echo $PWD | sed -e 's|/private||' -e "s|^$HOME|~|"
|
||||||
end
|
end
|
||||||
else
|
|
||||||
|
case '*'
|
||||||
function pwd --description "Print working directory"
|
function pwd --description "Print working directory"
|
||||||
echo $PWD | sed -e "s|^$HOME|~|"
|
echo $PWD | sed -e "s|^$HOME|~|"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
Loading…
x
Reference in New Issue
Block a user