From dd8558e8d7aa7ebb347ef451b76d33cc5e947b6b Mon Sep 17 00:00:00 2001 From: navan Date: Sun, 17 Mar 2024 16:32:50 +1100 Subject: [PATCH] if name is other than items, the modules folder will be dynamically created... --- docker/build/cm/templates/import-templates.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/build/cm/templates/import-templates.ps1 b/docker/build/cm/templates/import-templates.ps1 index 490ec5f9c..b936daa71 100644 --- a/docker/build/cm/templates/import-templates.ps1 +++ b/docker/build/cm/templates/import-templates.ps1 @@ -19,6 +19,11 @@ if (Test-Path $modulesPath) { } Copy-Item -Path (Join-Path $PSScriptRoot "modules_template") -Destination $modulesPath -Recurse -Force + +$sitecoreJson = Get-Content "sitecore.json" | ConvertFrom-Json +$defaultSerializationPath = $sitecoreJson.serialization.defaultModuleRelativeSerializationPath +if ($defaultSerializationPath -ne 'items') {Rename-Item -Path (Join-Path $PSScriptRoot "modules\items") -NewName $defaultSerializationPath} + Copy-Item -Path ".\.sitecore" -Destination $PSScriptRoot -Recurse -Force $files = Get-ChildItem -Path $modulesPath -Recurse -File | ForEach-Object {$_.FullName} foreach ($item in $files) {