Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
a56eac7a
Commit
a56eac7a
authored
Oct 10, 2016
by
Hong
Committed by
Marc Cornellà
Oct 10, 2016
Browse files
Use OSTYPE instead of uname whenever possible for better speed. (#5496)
parent
98cd3973
Changes
6
Show whitespace changes
Inline
Side-by-side
lib/theme-and-appearance.zsh
View file @
a56eac7a
...
@@ -6,11 +6,11 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
...
@@ -6,11 +6,11 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
if
[[
"
$DISABLE_LS_COLORS
"
!=
"true"
]]
;
then
if
[[
"
$DISABLE_LS_COLORS
"
!=
"true"
]]
;
then
# Find the option for using colors in ls, depending on the version
# Find the option for using colors in ls, depending on the version
if
[[
"
$
(
uname
-s
)
"
==
"NetBSD"
]]
;
then
if
[[
"
$
OSTYPE
"
==
netbsd
*
]]
;
then
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
gls
--color
-d
.
&>/dev/null
&&
alias ls
=
'gls --color=tty'
gls
--color
-d
.
&>/dev/null
&&
alias ls
=
'gls --color=tty'
elif
[[
"
$
(
uname
-s
)
"
==
"O
pen
BSD"
]]
;
then
elif
[[
"
$
OSTYPE
"
==
o
pen
bsd
*
]]
;
then
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
# with color and multibyte support) are available from ports. "colorls"
# with color and multibyte support) are available from ports. "colorls"
# will be installed on purpose and can't be pulled in by installing
# will be installed on purpose and can't be pulled in by installing
...
...
plugins/battery/battery.plugin.zsh
View file @
a56eac7a
...
@@ -64,7 +64,7 @@ if [[ "$OSTYPE" = darwin* ]] ; then
...
@@ -64,7 +64,7 @@ if [[ "$OSTYPE" = darwin* ]] ; then
[[
$(
ioreg
-rc
"AppleSmartBattery"
|
grep
'^.*"IsCharging"\ =\ '
|
sed
-e
's/^.*"IsCharging"\ =\ //'
)
==
"Yes"
]]
[[
$(
ioreg
-rc
"AppleSmartBattery"
|
grep
'^.*"IsCharging"\ =\ '
|
sed
-e
's/^.*"IsCharging"\ =\ //'
)
==
"Yes"
]]
}
}
elif
[[
$(
uname
)
==
"L
inux
"
]]
;
then
elif
[[
"
$OSTYPE
"
=
l
inux
*
]]
;
then
function
battery_is_charging
()
{
function
battery_is_charging
()
{
!
[[
$(
acpi 2>/dev/null |
grep
-c
'^Battery.*Discharging'
)
-gt
0
]]
!
[[
$(
acpi 2>/dev/null |
grep
-c
'^Battery.*Discharging'
)
-gt
0
]]
...
...
plugins/gitfast/git-completion.bash
View file @
a56eac7a
...
@@ -2771,6 +2771,6 @@ __git_complete gitk __gitk_main
...
@@ -2771,6 +2771,6 @@ __git_complete gitk __gitk_main
# when the user has tab-completed the executable name and consequently
# when the user has tab-completed the executable name and consequently
# included the '.exe' suffix.
# included the '.exe' suffix.
#
#
if
[
Cygwin
=
"
$(
uname
-o
2>/dev/null
)
"
]
;
then
if
[
[
"
$OSTYPE
"
=
cygwin
*
]
]
;
then
__git_complete git.exe __git_main
__git_complete git.exe __git_main
fi
fi
plugins/sublime/sublime.plugin.zsh
View file @
a56eac7a
if
[[
$(
'uname'
)
==
'L
inux
'
]]
;
then
if
[[
"
$OSTYPE
"
==
l
inux
*
]]
;
then
local
_sublime_linux_paths
>
/dev/null 2>&1
local
_sublime_linux_paths
>
/dev/null 2>&1
_sublime_linux_paths
=(
_sublime_linux_paths
=(
"
$HOME
/bin/sublime_text"
"
$HOME
/bin/sublime_text"
...
...
plugins/zsh-navigation-tools/_n-kill
View file @
a56eac7a
...
@@ -10,8 +10,8 @@ integer cygwin=0
...
@@ -10,8 +10,8 @@ integer cygwin=0
local IFS="
local IFS="
"
"
case "$
(uname)
" in
case "$
OSTYPE
" in
CYGWIN
*) list=( `command ps -Wa` ); cygwin=1 ;;
cygwin
*) list=( `command ps -Wa` ); cygwin=1 ;;
*) list=( `command ps -o pid,uid,command -A` ) ;;
*) list=( `command ps -o pid,uid,command -A` ) ;;
esac
esac
...
...
plugins/zsh-navigation-tools/n-kill
View file @
a56eac7a
...
@@ -42,8 +42,8 @@ NLIST_NONSELECTABLE_ELEMENTS=( 1 )
...
@@ -42,8 +42,8 @@ NLIST_NONSELECTABLE_ELEMENTS=( 1 )
type
ps 2>/dev/null 1>&2
||
{
echo
>
&2
"Error:
\`
ps' not found"
;
return
1
}
type
ps 2>/dev/null 1>&2
||
{
echo
>
&2
"Error:
\`
ps' not found"
;
return
1
}
case
"
$
(
uname
)
"
in
case
"
$
OSTYPE
"
in
CYGWIN
*
)
list
=(
`
command
ps
-Wa
`
)
;;
cygwin
*
)
list
=(
`
command
ps
-Wa
`
)
;;
*
)
list
=(
`
command
ps
-o
pid,uid,command
-A
`
)
;;
*
)
list
=(
`
command
ps
-o
pid,uid,command
-A
`
)
;;
esac
esac
...
...
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