Skip to content

Commit

Permalink
fix: set false if fixed folder for autoclean
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li authored Jan 23, 2023
1 parent 02ba772 commit d4696af
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugin/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Vault,
} from "obsidian";
import {
folderSettings,
GitHubPublisherSettings,
MetadataExtractor,
RepoFrontmatter,
Expand Down Expand Up @@ -456,7 +457,10 @@ export function getRepoFrontmatter(
owner: settings.githubName,
autoclean: settings.autoCleanUp,
};
if (!frontmatter) {
if (settings.downloadedFolder === folderSettings.fixed) {
repoFrontmatter.autoclean = false;
}
if (!frontmatter || frontmatter.multipleRepo === undefined || frontmatter.repo === undefined) {
return repoFrontmatter;
}
let isFrontmatterAutoClean= null;
Expand Down Expand Up @@ -485,7 +489,6 @@ export function getRepoFrontmatter(
const repo = frontmatter.repo.split("/");
isFrontmatterAutoClean= repo.length > 4 ? true : null;
repoFrontmatter = repositoryStringSlice(repo, repoFrontmatter);

}
}
if (frontmatter.autoclean !== undefined && isFrontmatterAutoClean === null) {
Expand Down Expand Up @@ -563,7 +566,8 @@ function parseMultipleRepo(
(t) =>
t.repo === v.repo &&
t.owner === v.owner &&
t.branch === v.branch
t.branch === v.branch &&
t.autoclean === v.autoclean
) === i
);
}
Expand Down

0 comments on commit d4696af

Please sign in to comment.