Skip to content

Commit 47e8c98

Browse files
committed
trim totalMemory
1 parent 1bc1d1f commit 47e8c98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Contexts/SpecsContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ private function totalMemory()
4646
{
4747
if (PHP_OS === 'Linux') {
4848
$output = shell_exec('free -m | grep Mem | awk \'{print $2}\'');
49-
$output = $output / 1024; // convert MB to GB
49+
$output = trim($output) / 1024; // convert MB to GB
5050
} elseif (PHP_OS === 'Darwin' || PHP_OS === 'FreeBSD') {
5151
$output = shell_exec('sysctl -n hw.memsize');
52-
$output = $output / 1073741824; // convert bytes to GB
52+
$output = trim($output) / 1073741824; // convert bytes to GB
5353
} else {
5454
throw new RuntimeException('Operating system not supported!');
5555
}

0 commit comments

Comments
 (0)