diff --git a/ue4-cleanup.ps1 b/ue4-cleanup.ps1 index fb525de..e0b0ce1 100644 --- a/ue4-cleanup.ps1 +++ b/ue4-cleanup.ps1 @@ -110,13 +110,17 @@ try { } - if (-not $nolfsprune) { - if ($dryrun) { - Write-Output "Would have pruned LFS files" - git lfs prune --dry-run - } else { - Write-Output "Pruning Git LFS files" - git lfs prune + + $isGit = Test-Path .git + if ($isGit) { + if (-not $nolfsprune) { + if ($dryrun) { + Write-Output "Would have pruned LFS files" + git lfs prune --dry-run + } else { + Write-Output "Pruning Git LFS files" + git lfs prune + } } } Write-Output "-- Cleanup finished OK --"