Skip to content

Commit

Permalink
fix: build DE source path for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Feb 5, 2025
1 parent d7a9a7f commit 79159bc
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/convert/transformers/defaultMetadataTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,15 @@ const getContentSourceDestination = (
component: SourceComponent,
mergeWith?: SourceComponent
): SourcePath => {
// TODO: remove this and fix how the source dest path is built for DEs being merged.
// bad path:
// `force-app/main/default/digitalExperiences/site/bundle1/sfdc_cms__site/bundle1/sfdc_cms__site`
if (component.type.id === 'digitalexperience') {
return component.getPackageRelativePath(source, targetFormat);
}
if (mergeWith?.content) {
if (component.content && component.tree.isDirectory(component.content)) {
const relative = trimUntil(source, basename(component.content));
return join(dirname(mergeWith.content), relative);
// DEs are always inside a dir.
if (component.type.id === 'digitalexperience') {
return join(mergeWith.content, basename(source));
} else {
const relative = trimUntil(source, basename(component.content));
return join(dirname(mergeWith.content), relative);
}
}
return mergeWith.content;
}
Expand Down

0 comments on commit 79159bc

Please sign in to comment.