Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
63bae2ab
Commit
63bae2ab
authored
Apr 23, 2014
by
Christian Höltje
Committed by
Christian Höltje
Jul 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use $OSTYPE instead of uname to speed things up
The $OSTYPE variable is set at ZSH compile time and can be safely used to determine the OS of the system. e.g. darwin (os x)
parent
207b6a1e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
7 deletions
+7
-7
battery.plugin.zsh
plugins/battery/battery.plugin.zsh
+1
-1
bundler.plugin.zsh
plugins/bundler/bundler.plugin.zsh
+1
-1
jira.plugin.zsh
plugins/jira/jira.plugin.zsh
+1
-1
node.plugin.zsh
plugins/node/node.plugin.zsh
+1
-1
rake-fast.plugin.zsh
plugins/rake-fast/rake-fast.plugin.zsh
+1
-1
sublime.plugin.zsh
plugins/sublime/sublime.plugin.zsh
+1
-1
web-search.plugin.zsh
plugins/web-search/web-search.plugin.zsh
+1
-1
No files found.
plugins/battery/battery.plugin.zsh
View file @
63bae2ab
...
...
@@ -8,7 +8,7 @@
# Modified to add support for Apple Mac #
###########################################
if
[[
$(
uname
)
==
"Darwin"
]]
;
then
if
[[
"
$OSTYPE
"
=
darwin
*
]]
;
then
function
battery_pct
()
{
local
smart_battery_status
=
"
$(
ioreg
-rc
"AppleSmartBattery"
)
"
...
...
plugins/bundler/bundler.plugin.zsh
View file @
63bae2ab
...
...
@@ -54,7 +54,7 @@ bundle_install() {
if
_bundler-installed
&&
_within-bundled-project
;
then
local
bundler_version
=
`
bundle version |
cut
-d
' '
-f3
`
if
[[
$bundler_version
>
'1.4.0'
||
$bundler_version
=
'1.4.0'
]]
;
then
if
[[
"
$
(
uname
)
"
==
'Darwin'
]]
if
[[
"
$
OSTYPE
"
=
darwin
*
]]
then
local
cores_num
=
"
$(
sysctl hw.ncpu |
awk
'{print $2}'
)
"
else
...
...
plugins/jira/jira.plugin.zsh
View file @
63bae2ab
...
...
@@ -12,7 +12,7 @@
# jira ABC-123 # Opens an existing issue
open_jira_issue
()
{
local
open_cmd
if
[[
$(
uname
-s
)
==
'Darwin'
]]
;
then
if
[[
"
$OSTYPE
"
=
darwin
*
]]
;
then
open_cmd
=
'open'
else
open_cmd
=
'xdg-open'
...
...
plugins/node/node.plugin.zsh
View file @
63bae2ab
...
...
@@ -3,7 +3,7 @@
function
node-docs
{
# get the open command
local
open_cmd
if
[[
$(
uname
-s
)
==
'Darwin'
]]
;
then
if
[[
"
$OSTYPE
"
=
darwin
*
]]
;
then
open_cmd
=
'open'
else
open_cmd
=
'xdg-open'
...
...
plugins/rake-fast/rake-fast.plugin.zsh
View file @
63bae2ab
...
...
@@ -10,7 +10,7 @@ _rake_refresh () {
_rake_does_task_list_need_generating
()
{
if
[
!
-f
.rake_tasks
]
;
then return
0
;
else
if
[[
$(
uname
-s
)
==
'Darwin'
]]
;
then
if
[[
"
$OSTYPE
"
=
darwin
*
]]
;
then
accurate
=
$(
stat
-f
%m .rake_tasks
)
changed
=
$(
stat
-f
%m Rakefile
)
else
...
...
plugins/sublime/sublime.plugin.zsh
View file @
63bae2ab
...
...
@@ -17,7 +17,7 @@ if [[ $('uname') == 'Linux' ]]; then
fi
done
elif
[[
$(
'uname'
)
==
'Darwin'
]]
;
then
elif
[[
"
$OSTYPE
"
=
darwin
*
]]
;
then
local
_sublime_darwin_paths
>
/dev/null 2>&1
_sublime_darwin_paths
=(
"/usr/local/bin/subl"
...
...
plugins/web-search/web-search.plugin.zsh
View file @
63bae2ab
...
...
@@ -4,7 +4,7 @@ function web_search() {
# get the open command
local
open_cmd
if
[[
$(
uname
-s
)
==
'Darwin'
]]
;
then
if
[[
"
$OSTYPE
"
=
darwin
*
]]
;
then
open_cmd
=
'open'
else
open_cmd
=
'xdg-open'
...
...
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