File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,10 @@ function Write-CustomError {
1313 }
1414}
1515
16- # Get .c files in current directory, ../src, or ./ src
16+ # Get .c files only in ..\ src
1717$cFiles = @ ()
18- foreach ($dir in @ (" ." , " ..\src" , " .\src" )) {
19- if (Test-Path $dir ) {
20- $cFiles += Get-ChildItem - Path $dir - Filter * .c - File | ForEach-Object { $_.FullName }
21- }
18+ if (Test-Path " ..\src" ) {
19+ $cFiles += Get-ChildItem - Path " ..\src" - Filter * .c - File | ForEach-Object { $_.FullName }
2220}
2321if (-not $cFiles ) {
2422 Write-CustomError " No .c files found in current directory. Exiting."
@@ -39,10 +37,10 @@ foreach ($arg in $args) {
3937$filesToCompile = @ ()
4038if ($specifiedFiles.Count -gt 0 ) {
4139 foreach ($file in $specifiedFiles ) {
42- if ($cFiles -contains $ file ) {
43- $filesToCompile += $ file
40+ if ($cFiles | Where-Object { [ System.IO.Path ]::GetFileName( $_ ) -eq $ file } ) {
41+ $filesToCompile += ( $cFiles | Where-Object { [ System.IO.Path ]::GetFileName( $_ ) -eq $ file } )
4442 } else {
45- Write-CustomError " Specified file not found: $file "
43+ Write-CustomError " Specified file not found in ..\src : $file "
4644 }
4745 }
4846} elseif ($acceptAll ) {
You can’t perform that action at this time.
0 commit comments