3030 directory as this script) as the target directory.
3131
3232. PARAMETER Version
33- The version of Apache RAT to use (default: 0.16 ).
33+ The version of Apache RAT to use (default: 0.13 ).
3434
3535. PARAMETER ExcludeFileName
3636 Name of an exclude file containing path patterns that RAT should ignore.
4343. EXAMPLE
4444 pwsh ./rat.ps1
4545
46- Runs Apache RAT (default version 0.16 ) with exclusions from `rat-exclude.txt`.
46+ Runs Apache RAT (default version 0.13 ) with exclusions from `rat-exclude.txt`.
4747
4848. EXAMPLE
49- pwsh ./rat.ps1 -Version 0.16 -ExcludeFileName custom-exclude.txt
49+ pwsh ./rat.ps1 -Version 0.13 -ExcludeFileName custom-exclude.txt
5050
51- Runs Apache RAT version 0.16 using the specified exclude file.
51+ Runs Apache RAT version 0.13 using the specified exclude file.
5252
5353. NOTES
5454 This script is intended for use by release managers when preparing official
5555 ASF releases. It is not normally required for day-to-day development.
5656#>
5757param (
58- [string ]$Version = " 0.16 " ,
58+ [string ]$Version = " 0.13 " ,
5959 [string ]$ExcludeFileName = " .rat-excludes"
6060)
6161
@@ -88,27 +88,20 @@ if (-not (Test-Path $ratExcludeFile)) {
8888 $useExclude = $true
8989}
9090
91- # Run from the script directory so '.' means the repository root next to this script
92- Push-Location $scriptDir
93- try {
94- $argsList = @ (
95- " -jar" , $ratJar ,
96- " --dir" , " ." ,
97- " --addLicense" ,
98- " --force"
99- )
100-
101- if ($useExclude ) {
102- $argsList += @ (" --exclude-file" , $ratExcludeFile )
103- }
104-
105- # Call java with argument list. Use & to invoke program.
106- & java @argsList
107-
108- if ($LASTEXITCODE -ne 0 ) {
109- throw " RAT exited with code $LASTEXITCODE "
110- }
91+ $argsList = @ (
92+ " -jar" , $ratJar ,
93+ " --dir" , " `" $scriptDir `" " ,
94+ " --addLicense" ,
95+ " --force"
96+ )
97+
98+ if ($useExclude ) {
99+ $argsList += @ (" --exclude-file" , " `" $ratExcludeFile `" " )
111100}
112- finally {
113- Pop-Location
101+
102+ # Call java with argument list. Use & to invoke program.
103+ & java @argsList
104+
105+ if ($LASTEXITCODE -ne 0 ) {
106+ throw " RAT exited with code $LASTEXITCODE "
114107}
0 commit comments