Fix multiple layout files with same file name

In the us localization (BC21) there are multiple rdlc files with the same name. This gives an error when running "Create-AlProjectFolderFromNavContainer". Fix: First search for a rdlc file in the current folder of the report.
This commit is contained in:
Chris Brandemann 2022-10-28 10:35:42 +02:00 коммит произвёл GitHub
Родитель 59ad1fa312
Коммит e893cfc00c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -39,6 +39,7 @@ try {
$files | Where-Object { ($extensions.Contains($_.Extension.ToLowerInvariant())) -and !($_.Attributes.HasFlag([System.IO.FileAttributes]::Directory)) } | ForEach-Object {
$filename = $_.Name
$directoryname = $_.DirectoryName
$content = [System.IO.File]::ReadAllLines($_.FullName)
try {
@ -133,7 +134,10 @@ try {
$endIdx = $line.LastIndexOf("'")
$layoutFilename = $line.SubString($startIdx, $endIdx-$startIdx)
$layoutFilename = $layoutFilename.SubString($layoutFilename.LastIndexOfAny(@('\','/'))+1)
$layoutFile = $Files | Where-Object { ($_.name -eq $layoutFilename) -and ($_.DirectoryName -eq $DirectoryName)}
if (!($layoutFile)){
$layoutFile = $Files | Where-Object { $_.name -eq $layoutFilename }
}
if ($layoutFile) {
$layoutcontent = [System.IO.File]::ReadAllBytes($layoutFile.FullName)