Skip to content

Commit

Permalink
Add support for relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarypiatek committed Nov 8, 2016
1 parent 36cc0f3 commit 1379347
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 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 @@ -32,7 +32,7 @@ function Get-FilesLOC
Remove-Item $OutFilePath -ErrorAction SilentlyContinue
$excludeParam = if ($DirToExclude){"--exclude-dir=$($DirToExclude -join ',')"}else {$null}
Write-Verbose "Exclude $excludeParam"
& $clocExePath --by-file --csv --skip-uniqueness $excludeParam --out="$OutFilePath" $CheckoutDir | Write-Verbose
& $clocExePath --by-file --csv --skip-uniqueness $excludeParam --out="$OutFilePath" (Get-Item $CheckoutDir).FullName | Write-Verbose
if(-not(Test-Path $OutFilePath))
{
$PSCmdlet.ThrowTerminatingError("Cannot create LOC statistics file")
Expand Down Expand Up @@ -114,7 +114,8 @@ function Bundle-Report{
[CmdletBinding()]
Param($ClocDataFile, $SvnLogFile, $OutDataFile)
Write-Verbose "Start bundling report"
$cleanCheckoutDir = $CheckoutDir -replace "\\","/"
$cleanCheckoutDir = ((Get-Item $CheckoutDir).FullName) -replace "\\","/"
Write-Verbose "Checkout dir: $cleanCheckoutDir"
$vcsModulePath = Get-VcsModulePath
& "$scriptPath\CodeTopologyBuilder.exe" $cleanCheckoutDir $vcsModulePath $SvnLogFile $ClocDataFile $OutDataFile
Write-Verbose "Svn module: $vcsModulePath"
Expand Down Expand Up @@ -196,4 +197,4 @@ switch($VCS)
}

Bundle-Report -ClocDataFile "$tmpDir\cloc.csv" -SvnLogFile "$tmpDir\svnlogfile.xml" -OutDataFile "$tmpDir\result.json"
Remove-Item $tmpDir -Recurse -Force
Remove-Item $tmpDir -Recurse -Force

0 comments on commit 1379347

Please sign in to comment.