Skip to content

Commit 7b74af9

Browse files
author
Al Manning
committed
more windows refactoring for space changes
1 parent 22ab865 commit 7b74af9

File tree

2 files changed

+482
-20
lines changed

2 files changed

+482
-20
lines changed

src/publish/confluence/confluence-helper.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,12 @@ export const buildSpaceChanges = (
317317
(page: SitePage) => page?.metadata?.fileName === fileName
318318
);
319319

320-
const existingPage = findPageInExistingSite(fileMetadata.fileName);
320+
const universalFileName = pathWithForwardSlashes(fileMetadata.fileName);
321+
const existingPage = findPageInExistingSite(universalFileName);
321322

322323
let spaceChangeList: ConfluenceSpaceChange[] = [];
323324

324-
const pathList = fileMetadata.fileName.split("/");
325+
const pathList = universalFileName.split("/");
325326

326327
let pageParent =
327328
pathList.length > 1
@@ -335,14 +336,18 @@ export const buildSpaceChanges = (
335336

336337
let existingSiteParent = null;
337338

339+
//TODO update with deno paths after tests are in place
338340
const parentsList = pathList.slice(0, pathList.length - 1);
339341

340342
parentsList.forEach((parentFileName, index) => {
341343
const ancestorFilePath = parentsList.slice(0, index).join("/");
342344

343345
const ancestor = index > 0 ? ancestorFilePath : parent?.parent;
344346

347+
console.log("parentFileName", parentFileName);
348+
345349
let fileName = `${ancestorFilePath}/${parentFileName}`;
350+
console.log("fileName", fileName);
346351
if (fileName.startsWith("/")) {
347352
fileName = parentFileName;
348353
}
@@ -368,6 +373,8 @@ export const buildSpaceChanges = (
368373

369374
const existingAncestor = findPageInExistingSite(ancestor ?? "");
370375

376+
console.log("fileNameToSave", fileName);
377+
371378
spaceChangeList = [
372379
...spaceChangeList,
373380
buildContentCreate(
@@ -407,7 +414,7 @@ export const buildSpaceChanges = (
407414
existingPage.id,
408415
useOriginalTitle ? fileMetadata.originalTitle : fileMetadata.title,
409416
fileMetadata.contentBody,
410-
fileMetadata.fileName,
417+
universalFileName,
411418
pageParent
412419
),
413420
];
@@ -418,7 +425,7 @@ export const buildSpaceChanges = (
418425
fileMetadata.title,
419426
space,
420427
fileMetadata.contentBody,
421-
fileMetadata.fileName,
428+
universalFileName,
422429
pageParent,
423430
ContentStatusEnum.current
424431
),

0 commit comments

Comments
 (0)