Skip to content

Commit

Permalink
fix: typo that breaks obsidian path creating
Browse files Browse the repository at this point in the history
close #272
  • Loading branch information
Mara-Li committed Jan 16, 2024
1 parent e176f7d commit f9e67d6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/conversion/file_path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,11 @@ function createObsidianPath(
repoFrontmatter?: RepoFrontmatter,
): string {
fileName = folderNoteIndexOBS(file, vault, settings, fileName);
const rootFolder = repoFrontmatter?.path?.defaultName && repoFrontmatter.path.defaultName.length > 0 ? repoFrontmatter.path.rootFolder : settings.upload.defaultName.length > 0 ? settings.upload.defaultName : "";
const path = rootFolder + fileName;

const defaultFolder = repoFrontmatter?.path?.defaultName && repoFrontmatter.path.defaultName.length > 0 ?
repoFrontmatter.path.defaultName : settings.upload.defaultName.length > 0 ?
settings.upload.defaultName : "";
const path = defaultFolder + fileName;
//remove last word from path splitted with /
let pathWithoutEnd = path.split("/").slice(0, -1).join("/");
//get file name only
Expand Down Expand Up @@ -379,7 +382,6 @@ export function getReceiptFolder(
if (!targetRepo) targetRepo = repoFrontmatter[0];
const fileName = getTitleField(frontmatter, file, settings);
const editedFileName = regexOnFileName(fileName, settings);

if (
!isShared(frontmatter, settings, file, otherRepo)
) {
Expand Down

0 comments on commit f9e67d6

Please sign in to comment.