From 076effdab718709df8c0a57faca917d3d152a41b Mon Sep 17 00:00:00 2001 From: Andrew McClenaghan Date: Sat, 29 Apr 2023 09:25:43 +1000 Subject: [PATCH] fix: Update the common path to include parent --- packages/lib/src/TreeLocal.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 = (