Skip to content

Commit

Permalink
Fix check for empty config file
Browse files Browse the repository at this point in the history
Closes #125
  • Loading branch information
rashil2000 authored Jan 31, 2022
1 parent 8f3d1ce commit 07cce61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion winfetch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ if ($genconf -and (Test-Path $configPath)) {
if ($result -eq 0) { Remove-Item -Path $configPath } else { exit 1 }
}

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

0 comments on commit 07cce61

Please sign in to comment.