Improve CPU core detection in Vagrantfile
Use single `grep` with `^` condition instead of `grep` + `cat` + `wc`
This commit is contained in:
parent
315564ae94
commit
5b7a5cc73a
|
@ -156,7 +156,7 @@ def suggestedCPUCores()
|
||||||
when /darwin/
|
when /darwin/
|
||||||
Integer(`sysctl -n hw.ncpu`) / 2
|
Integer(`sysctl -n hw.ncpu`) / 2
|
||||||
when /linux/
|
when /linux/
|
||||||
Integer(`cat /proc/cpuinfo | grep processor | wc -l`) / 2
|
Integer(`grep -c ^processor /proc/cpuinfo`) / 2
|
||||||
else
|
else
|
||||||
2
|
2
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue