Skip to content

Commit 3575784

Browse files
author
Al Manning
committed
remove dead code
1 parent 366f081 commit 3575784

File tree

2 files changed

+0
-73
lines changed

2 files changed

+0
-73
lines changed

src/publish/confluence/confluence-helper.ts

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -648,64 +648,3 @@ export const findAttachments = (
648648

649649
return uniqueResult ?? [];
650650
};
651-
652-
export const getAttachmentsDirectoryOld = (
653-
baseDirectory: string,
654-
filePath: string = "",
655-
attachmentPath: string = ""
656-
): string => {
657-
let result = baseDirectory;
658-
659-
if (attachmentPath.length === 0 || filePath.length === 0) {
660-
return "";
661-
}
662-
663-
//FIXME use DENO
664-
const filePathList = filePath.split("/");
665-
let attachmentPathList = attachmentPath.split("/");
666-
667-
//TODO navigate path with '..'
668-
if (attachmentPathList.length === 2 && attachmentPathList[0] === ".") {
669-
attachmentPathList = attachmentPathList.slice(1);
670-
}
671-
672-
const pathNoFileFromList = (pathList: string[]) =>
673-
pathList.slice(0, pathList.length - 1).join("/");
674-
675-
if (attachmentPathList.some((path) => path.endsWith("_files"))) {
676-
return baseDirectory;
677-
}
678-
679-
if (result.endsWith("/_site")) {
680-
result = result.slice(0, -6);
681-
}
682-
683-
const isRelative = attachmentPathList.length === 1;
684-
685-
if (isRelative && filePathList.length > 1) {
686-
const directoryPath = pathNoFileFromList(filePathList);
687-
result = `${result}/${directoryPath}`;
688-
}
689-
690-
return result;
691-
};
692-
693-
export const getAttachmentsDirectory = (
694-
baseDirectory: string,
695-
filePath: string = "",
696-
attachmentPath: string = ""
697-
): string => {
698-
let result = baseDirectory;
699-
700-
const baseParse = parse(baseDirectory);
701-
const baseDirectoryBaseName = basename(baseDirectory);
702-
703-
if (attachmentPath.length === 0 || filePath.length === 0) {
704-
return "";
705-
}
706-
707-
if (baseDirectoryBaseName === "_site") {
708-
}
709-
710-
return result;
711-
};

src/publish/confluence/confluence.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import {
5353
doWithSpinner,
5454
filterFilesForUpdate,
5555
findAttachments,
56-
getAttachmentsDirectory,
5756
getNextVersion,
5857
getTitle,
5958
isContentCreate,
@@ -290,17 +289,6 @@ async function publish(
290289
const uploadAttachment = async (
291290
attachmentPath: string
292291
): Promise<AttachmentSummary | null> => {
293-
// const uploadDirectory = getAttachmentsDirectory(
294-
// baseDirectory,
295-
// filePath,
296-
// attachmentPath
297-
// );
298-
//
299-
//
300-
//
301-
//
302-
//
303-
304292
let fileBuffer: Uint8Array;
305293
let fileHash: string;
306294
const path = join(baseDirectory, attachmentPath);

0 commit comments

Comments
 (0)