From 2afce3af97d0f02adf0147ea0f411a8b6e155901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Pi=C4=85tek?= Date: Tue, 8 Nov 2016 22:51:43 +0100 Subject: [PATCH] Add a set of default ignored directories --- src/GenerateReport.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/GenerateReport.ps1 b/src/GenerateReport.ps1 index d185f5e..84db8b3 100644 --- a/src/GenerateReport.ps1 +++ b/src/GenerateReport.ps1 @@ -2,7 +2,7 @@ param( $CheckoutDir, [Parameter(Mandatory=$true)][ValidateSet('SVN','Git')]$VCS, - [string[]]$DirToExclude + [string[]]$DirToExclude ) $scriptPath = if($PSScriptRoot -eq $null){"."} else {$PSScriptRoot} @@ -30,7 +30,9 @@ function Get-FilesLOC } Write-Verbose "Start colecting LOC statistics" Remove-Item $OutFilePath -ErrorAction SilentlyContinue - $excludeParam = if ($DirToExclude){"--exclude-dir=$($DirToExclude -join ',')"}else {$null} + $defaultIgnored =@("Bin","Obj","Lib","bin","obj","packages","lib","App_Data","node_modules", "bower_components") + $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 if(-not(Test-Path $OutFilePath))