Skip to content

Commit

Permalink
fix(publish): Checking file extension during publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Apr 26, 2022
1 parent 7f3a0b3 commit c44c268
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mkdocsPublisher/utils/publication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class MkdocsPublish {
async publish (file: TFile, one_file = false) {
const sharedKey = this.settings.shareKey
const frontmatter = this.metadataCache.getCache(file.path).frontmatter
if (!frontmatter || !frontmatter[sharedKey] || this.checkExcludedFolder(file)) {
if (!frontmatter || !frontmatter[sharedKey] || this.checkExcludedFolder(file) || file.extension !== 'md') {
return false
}
try {
Expand Down Expand Up @@ -130,8 +130,9 @@ export default class MkdocsPublish {
// @ts-ignore
payload.sha = response.data.sha
}
} catch (e) {
// ignore
} catch {
throw {}

}
payload.message = `Update note ${title}`
await octokit.request('PUT /repos/{owner}/{repo}/contents/{path}', payload)
Expand Down

0 comments on commit c44c268

Please sign in to comment.