summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2014-09-05 21:15:57 +0200
committerRobby Russell <robby@planetargon.com>2014-09-05 21:15:57 +0200
commit4bba11dbefbb96441e28221d322df07e737239a2 (patch)
treea1b45296910a2b512ecfc9247f793e9f6e87cb0f
parentffe8ce5b1e2641a4ebdf157310f77486a6a97013 (diff)
parent63bae2aba9c43a70bbb374fc46e287d7bc46cc54 (diff)
downloadzsh-4bba11dbefbb96441e28221d322df07e737239a2.tar.gz
zsh-4bba11dbefbb96441e28221d322df07e737239a2.tar.bz2
zsh-4bba11dbefbb96441e28221d322df07e737239a2.zip
Merge pull request #2744 from docwhat/ostype-not-uname
Use $OSTYPE instead of uname to speed things up
-rw-r--r--plugins/battery/battery.plugin.zsh2
-rw-r--r--plugins/bundler/bundler.plugin.zsh2
-rw-r--r--plugins/jira/jira.plugin.zsh2
-rw-r--r--plugins/node/node.plugin.zsh2
-rw-r--r--plugins/rake-fast/rake-fast.plugin.zsh2
-rw-r--r--plugins/sublime/sublime.plugin.zsh2
-rw-r--r--plugins/web-search/web-search.plugin.zsh2
7 files changed, 7 insertions, 7 deletions
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index 32dd4b624..014bb15dd 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -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")"
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index 617dcde71..ba3d3f623 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/plugins/bundler/bundler.plugin.zsh
@@ -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
diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
index a6d08410f..4a36b882d 100644
--- a/plugins/jira/jira.plugin.zsh
+++ b/plugins/jira/jira.plugin.zsh
@@ -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'
diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh
index 2d78f2b4c..39d8b10d9 100644
--- a/plugins/node/node.plugin.zsh
+++ b/plugins/node/node.plugin.zsh
@@ -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'
diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh
index cb84f69a1..cfc9a079f 100644
--- a/plugins/rake-fast/rake-fast.plugin.zsh
+++ b/plugins/rake-fast/rake-fast.plugin.zsh
@@ -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
diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
index 438f386fb..5acc75cc7 100644
--- a/plugins/sublime/sublime.plugin.zsh
+++ b/plugins/sublime/sublime.plugin.zsh
@@ -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"
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
index e157a389d..371e3a303 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -3,7 +3,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'