Skip to content

Commit

Permalink
bundler plugin: Simplify retrieval of cpu count on OSX (ohmyzsh#5180)
Browse files Browse the repository at this point in the history
Calling awk is not necessary here, sysctl has the -n flag to print the value.

Signed-off-by: Clemens Gruber <clemensgru@gmail.com>
  • Loading branch information
clemensg authored and mhowell committed Aug 13, 2016
1 parent 06efc30 commit b0ac92c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/bundler/bundler.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b0ac92c

Please sign in to comment.