mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-02 19:18:13 -05:00
✨ Feature: cli support uploading image with url
This commit is contained in:
parent
7b50ba7ddb
commit
e8489182d7
@ -1,6 +1,7 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import { Logger } from 'picgo'
|
import { Logger } from 'picgo'
|
||||||
|
import { isUrl } from '~/universal/utils/common'
|
||||||
interface IResultFileObject {
|
interface IResultFileObject {
|
||||||
path: string
|
path: string
|
||||||
}
|
}
|
||||||
@ -34,6 +35,11 @@ const getUploadFiles = (argv = process.argv, cwd = process.cwd(), logger: Logger
|
|||||||
return null // for uploading images in clipboard
|
return null // for uploading images in clipboard
|
||||||
} else if ((fileList?.length || 0) > 0) {
|
} else if ((fileList?.length || 0) > 0) {
|
||||||
const result = fileList!.map(item => {
|
const result = fileList!.map(item => {
|
||||||
|
if (isUrl(item)) {
|
||||||
|
return {
|
||||||
|
path: item
|
||||||
|
}
|
||||||
|
}
|
||||||
if (path.isAbsolute(item)) {
|
if (path.isAbsolute(item)) {
|
||||||
return {
|
return {
|
||||||
path: item
|
path: item
|
||||||
|
Loading…
Reference in New Issue
Block a user