Skip to content

Commit

Permalink
fix: shortRepo with frontmatter doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed May 18, 2023
1 parent 5b53e7b commit 307bf05
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Publisher from "../publish/upload";
import {getReceiptFolder} from "../conversion/filePath";
import i18next from "i18next";
import {Octokit} from "@octokit/core";
import { type } from "os";


/**
Expand Down Expand Up @@ -376,7 +377,7 @@ export function getRepoFrontmatter(
frontmatter?: FrontMatterCache
) {
let github = repository ?? settings.github;
if (frontmatter && frontmatter.shortRepo instanceof String) {
if (frontmatter && typeof frontmatter["shortRepo"] === "string") {
const smartKey = frontmatter.shortRepo.toLowerCase();
const allOtherRepo = settings.github.otherRepo;
const shortRepo = allOtherRepo.filter((repo) => {
Expand All @@ -393,7 +394,7 @@ export function getRepoFrontmatter(
if (settings.upload.behavior === FolderSettings.fixed) {
repoFrontmatter.autoclean = false;
}
if (!frontmatter || (frontmatter.multipleRepo === undefined && frontmatter.repo === undefined)) {
if (!frontmatter || (frontmatter.multipleRepo === undefined && frontmatter.repo === undefined && frontmatter.shortRepo === undefined)) {
return repoFrontmatter;
}
let isFrontmatterAutoClean= null;
Expand Down

0 comments on commit 307bf05

Please sign in to comment.