Skip to content

Commit

Permalink
feat: set encode false
Browse files Browse the repository at this point in the history
  • Loading branch information
fish.yu committed Apr 17, 2024
1 parent d9ea281 commit e3ff302
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class Downloader {
const content = await downloadImage(cover);
const imageName = crypto.randomUUID() + '.' + cover.split('.').pop();
const imageUrl = `_images/${imageName}`;
await gh.writeFile(imageUrl, content)
await gh.writeFile(imageUrl, content, { encode: false })
mdBody = `![${title}](${cover})`
}
const content = decoratePost(title, mdBody, `https://www.yuque.com/${client.namespace}/${slug}`)
Expand Down
4 changes: 2 additions & 2 deletions lib/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class GitHubClient extends GitHub {
return res;
}

async writeFile (name, content ) {
async writeFile (name, content, options ) {
let res;
try {
const { data } = await this.repo.writeFile('master', name, content, `update file ${name}`)
const { data } = await this.repo.writeFile('master', name, content, `update file ${name}`, options)
res = { status: true, data }
} catch (error) {
res = handler(error.response || { message: error.message })
Expand Down

0 comments on commit e3ff302

Please sign in to comment.