diff --git a/packages/lib/src/TreeLocal.ts b/packages/lib/src/TreeLocal.ts index 196b55b6..a9055ce3 100644 --- a/packages/lib/src/TreeLocal.ts +++ b/packages/lib/src/TreeLocal.ts @@ -91,7 +91,13 @@ const processNode = (commonPath: string, node: LocalAdfFileTreeNode) => { } } - node.children.forEach((childNode) => processNode(commonPath, childNode)); + const childCommonPath = path.parse( + node?.file?.absoluteFilePath ?? commonPath + ).dir; + + node.children.forEach((childNode) => + processNode(childCommonPath, childNode) + ); }; export const createFolderStructure = (