Skip to content

Commit 07cce61

Browse files
authored
Fix check for empty config file
Closes lptstr#125
1 parent 8f3d1ce commit 07cce61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

winfetch.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ if ($genconf -and (Test-Path $configPath)) {
357357
if ($result -eq 0) { Remove-Item -Path $configPath } else { exit 1 }
358358
}
359359

360-
if (-not (Test-Path $configPath) -or ((Get-Item -Path $configPath).Length -eq 0)) {
360+
if (-not (Test-Path $configPath) -or [String]::IsNullOrWhiteSpace((Get-Content $configPath))) {
361361
New-Item -Type File -Path $configPath -Value $defaultConfig -Force | Out-Null
362362
if ($genconf) {
363363
Write-Host "Saved default config to '$configPath'."

0 commit comments

Comments
 (0)