Skip to content

Commit

Permalink
Add a set of default ignored directories
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarypiatek committed Nov 10, 2016
1 parent 1379347 commit 2afce3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/GenerateReport.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
param(
$CheckoutDir,
[Parameter(Mandatory=$true)][ValidateSet('SVN','Git')]$VCS,
[string[]]$DirToExclude
[string[]]$DirToExclude
)

$scriptPath = if($PSScriptRoot -eq $null){"."} else {$PSScriptRoot}
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 2afce3a

Please sign in to comment.