mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
enable b2 folder upload
This commit is contained in:
parent
7b6d32a8a9
commit
738268e31d
@ -92,26 +92,24 @@ export default async ({
|
|||||||
try {
|
try {
|
||||||
switch (service) {
|
switch (service) {
|
||||||
case "b2":
|
case "b2":
|
||||||
if (isDirectory) {
|
|
||||||
throw new OperationError(500, "B2 storage does not support directory upload. yet...")
|
|
||||||
}
|
|
||||||
if (!global.b2Storage) {
|
if (!global.b2Storage) {
|
||||||
throw new OperationError(500, "B2 storage not configured on environment, unsupported service. Please use `standard` service.")
|
throw new OperationError(500, "B2 storage not configured on environment, unsupported service. Please use `standard` service.")
|
||||||
}
|
}
|
||||||
|
|
||||||
result = await B2Upload({
|
result = await B2Upload({
|
||||||
source,
|
source: isDirectory ? path.dirname(source) : source,
|
||||||
remotePath,
|
remotePath: remotePath,
|
||||||
metadata,
|
metadata: metadata,
|
||||||
isDirectory,
|
isDirectory: isDirectory,
|
||||||
|
targetFilename: isDirectory ? path.basename(source) : null,
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
case "standard":
|
case "standard":
|
||||||
result = await StandardUpload({
|
result = await StandardUpload({
|
||||||
source: isDirectory ? path.dirname(source) : source,
|
source: isDirectory ? path.dirname(source) : source,
|
||||||
remotePath,
|
remotePath: remotePath,
|
||||||
metadata,
|
metadata: metadata,
|
||||||
isDirectory,
|
isDirectory: isDirectory,
|
||||||
targetFilename: isDirectory ? path.basename(source) : null,
|
targetFilename: isDirectory ? path.basename(source) : null,
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user