fix data naming conflict

This commit is contained in:
Raymond Berger 2024-01-08 21:59:26 +01:00 committed by GitHub
parent 5ee29c6072
commit 5aaad66fe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -358,10 +358,10 @@ public function isLogDrainEnabled()
public function validateOS(): bool | Stringable
{
$os_release = instant_remote_process(['cat /etc/os-release'], $this);
$data = collect(explode("\n", $os_release));
$releaseLines = collect(explode("\n", $os_release));
$collectedData = collect([]);
foreach ($data as $data) {
$item = Str::of($data)->trim();
foreach ($releaseLines as $line) {
$item = Str::of($line)->trim();
$collectedData->put($item->before('=')->value(), $item->after('=')->lower()->replace('"', '')->value());
}
$ID = data_get($collectedData, 'ID');