浏览代码

bundler plugin: Simplify retrieval of cpu count on OSX (#5180)

Calling awk is not necessary here, sysctl has the -n flag to print the value.

Signed-off-by: Clemens Gruber <clemensgru@gmail.com>
Clemens Gruber 8 年之前
父节点
当前提交
7fabc8bca4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/bundler/bundler.plugin.zsh

+ 1 - 1
plugins/bundler/bundler.plugin.zsh

@@ -58,7 +58,7 @@ bundle_install() {
     if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
       if [[ "$OSTYPE" = darwin* ]]
       then
-        local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
+        local cores_num="$(sysctl -n hw.ncpu)"
       else
         local cores_num="$(nproc)"
       fi