Skip to content

Commit

Permalink
✨ Feature: cli support uploading image with url
Browse files Browse the repository at this point in the history
  • Loading branch information
Molunerfinn committed Aug 26, 2022
1 parent 7b50ba7 commit e848918
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/utils/handleArgv.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'path'
import fs from 'fs-extra'
import { Logger } from 'picgo'
import { isUrl } from '~/universal/utils/common'
interface IResultFileObject {
path: string
}
Expand Down Expand Up @@ -34,6 +35,11 @@ const getUploadFiles = (argv = process.argv, cwd = process.cwd(), logger: Logger
return null // for uploading images in clipboard
} else if ((fileList?.length || 0) > 0) {
const result = fileList!.map(item => {
if (isUrl(item)) {
return {
path: item
}
}
if (path.isAbsolute(item)) {
return {
path: item
Expand Down

0 comments on commit e848918

Please sign in to comment.