mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-16 01:40:35 -06:00
Compare commits
3 Commits
07e154459d
...
895a95ccf6
Author | SHA1 | Date | |
---|---|---|---|
|
895a95ccf6 | ||
|
558c634b70 | ||
|
674ab0308b |
@ -46,7 +46,7 @@ if (-NOT $SkipPreprocessing) {
|
|||||||
$preprocessingFilePath = ".\tools\Invoke-Preprocessing.ps1"
|
$preprocessingFilePath = ".\tools\Invoke-Preprocessing.ps1"
|
||||||
. $preprocessingFilePath
|
. $preprocessingFilePath
|
||||||
|
|
||||||
$excludedFiles = @('.\.git\', '.\.gitignore', '.\.gitattributes', '.\.github\CODEOWNERS', '.\LICENSE', "$preprocessingFilePath", '*.png', '*.exe')
|
$excludedFiles = @('.\.git\', '.\.gitignore', '.\.gitattributes', '.\.github\CODEOWNERS', '.\.github\LICENSE', "$preprocessingFilePath", '*.png', '*.exe')
|
||||||
$msg = "Pre-req: Code Formatting"
|
$msg = "Pre-req: Code Formatting"
|
||||||
Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -ProgressStatusMessage $msg -ThrowExceptionOnEmptyFilesList
|
Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -ProgressStatusMessage $msg -ThrowExceptionOnEmptyFilesList
|
||||||
}
|
}
|
||||||
|
@ -75,23 +75,31 @@
|
|||||||
$count = $ExcludedFiles.Count
|
$count = $ExcludedFiles.Count
|
||||||
|
|
||||||
# Make sure there's a * at the end of folders in ExcludedFiles list
|
# Make sure there's a * at the end of folders in ExcludedFiles list
|
||||||
if ($count -gt 0) {
|
|
||||||
for ($i = 0; $i -lt $count; $i++) {
|
for ($i = 0; $i -lt $count; $i++) {
|
||||||
$excludedFile = $ExcludedFiles[$i]
|
$excludedFile = $ExcludedFiles[$i]
|
||||||
$isFolder = ($excludedFile) -match '\\$'
|
$isFolder = ($excludedFile) -match '\\$'
|
||||||
if ($isFolder) { $ExcludedFiles[$i] = $excludedFile + '*' }
|
if ($isFolder) { $ExcludedFiles[$i] = $excludedFile + '*' }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
# Validate the ExcludedFiles List before continuing on,
|
# Validate the ExcludedFiles List before continuing on,
|
||||||
# that's if there's a list in the first place, and '-SkipExcludedFilesValidation' was not provided.
|
# that's if there's a list in the first place, and '-SkipExcludedFilesValidation' was not provided.
|
||||||
if ((-NOT ($count -eq 0)) -AND (-NOT $SkipExcludedFilesValidation)) {
|
if (-not $SkipExcludedFilesValidation) {
|
||||||
for ($i = 0; $i -lt $count; $i++) {
|
for ($i = 0; $i -lt $count; $i++) {
|
||||||
$excludedFile = $ExcludedFiles[$i]
|
$excludedFile = $ExcludedFiles[$i]
|
||||||
$filePath = "$(($WorkingDir -replace ('\\$', '')) + '\' + ($excludedFile -replace ('\.\\', '')))"
|
$filePath = "$(($WorkingDir -replace ('\\$', '')) + '\' + ($excludedFile -replace ('\.\\', '')))"
|
||||||
|
|
||||||
|
# Handle paths with wildcards in a different implementation
|
||||||
|
$matches = ($filePath) -match '^.*?\*'
|
||||||
|
|
||||||
|
if ($matches) {
|
||||||
if (-NOT (Get-ChildItem -Recurse -Path "$filePath" -File)) {
|
if (-NOT (Get-ChildItem -Recurse -Path "$filePath" -File)) {
|
||||||
$failedFilesList += "'$filePath', "
|
$failedFilesList += "'$filePath', "
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (-NOT (Test-Path -Path "$filePath")) {
|
||||||
|
$failedFilesList += "'$filePath', "
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$failedFilesList = $failedFilesList -replace (',\s*$', '')
|
$failedFilesList = $failedFilesList -replace (',\s*$', '')
|
||||||
if (-NOT $failedFilesList -eq "") {
|
if (-NOT $failedFilesList -eq "") {
|
||||||
|
Loading…
Reference in New Issue
Block a user