From 9044cbed69878bf7d65d5f6c1905dcd45ed046f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Pi=C4=85tek?= Date: Sun, 13 Nov 2016 18:17:15 +0100 Subject: [PATCH] Add constrain for max file size to prevent out of memory exception from CLOC --- src/GenerateReport.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GenerateReport.ps1 b/src/GenerateReport.ps1 index 84db8b3..193b3ee 100644 --- a/src/GenerateReport.ps1 +++ b/src/GenerateReport.ps1 @@ -34,7 +34,7 @@ function Get-FilesLOC $toExclude = $DirToExclude+$defaultIgnored $excludeParam = "--exclude-dir=$($toExclude -join ',')" Write-Verbose "Exclude $excludeParam" - & $clocExePath --by-file --csv --skip-uniqueness $excludeParam --out="$OutFilePath" (Get-Item $CheckoutDir).FullName | Write-Verbose + & $clocExePath --by-file --csv --skip-uniqueness $excludeParam --max-file-size=2 --out="$OutFilePath" (Get-Item $CheckoutDir).FullName | Write-Verbose if(-not(Test-Path $OutFilePath)) { $PSCmdlet.ThrowTerminatingError("Cannot create LOC statistics file")