Skip to content

Commit

Permalink
Fix picgo and cliScript uploader (marktext#2915)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xander-C committed Jun 8, 2022
1 parent 2bb405a commit 3d3cd17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/renderer/util/fileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ export const uploadImage = async (pathname, image, preferences) => {
})
}

const uploadByCommand = async (uploader, filepath) => {
const uploadByCommand = async (uploader, filepath, filename) => {
let isPath = true
if (typeof filepath !== 'string') {
isPath = false
const data = new Uint8Array(filepath)
filepath = path.join(tmpdir(), +new Date())
filepath = path.join(tmpdir(), +new Date() + filename)
await fs.writeFile(filepath, data)
}
if (uploader === 'picgo') {
Expand Down Expand Up @@ -224,7 +224,7 @@ export const uploadImage = async (pathname, image, preferences) => {
switch (currentUploader) {
case 'picgo':
case 'cliScript':
uploadByCommand(currentUploader, reader.result)
uploadByCommand(currentUploader, reader.result, image.name)
break
default:
uploadByGithub(reader.result, image.name)
Expand Down

0 comments on commit 3d3cd17

Please sign in to comment.