7fabc8bca41d4ff7090325116a85513dac852236

Author
Clemens Gruber <clemensgru@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

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>

Diff

 1diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
 2index 382a1a471cca4255e848147d46453709d35aa1e9..c5284dbb19d6853f8353f2f2ffc14dc064a905a8 100644
 3--- a/plugins/bundler/bundler.plugin.zsh
 4+++ b/plugins/bundler/bundler.plugin.zsh
 5@@ -58,7 +58,7 @@ bundle_install() {
 6     if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
 7       if [[ "$OSTYPE" = darwin* ]]
 8       then
 9-        local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
10+        local cores_num="$(sysctl -n hw.ncpu)"
11       else
12         local cores_num="$(nproc)"
13       fi