fix: add the override options.
This commit is contained in:
parent
c01279c4e3
commit
d1a0943b33
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "astro-uploader",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"description": "A uploader for uploading the Astro generated files through the S3 API.",
|
||||
"keywords": ["Astro", "S3", "withastro", "opendal"],
|
||||
"bugs": {
|
||||
|
@ -99,15 +99,12 @@ class Uploader {
|
||||
const exist = await this.operator.isExist(key);
|
||||
if (exist) {
|
||||
const { contentLength } = await this.operator.stat(key);
|
||||
if (contentLength !== null && contentLength !== BigInt(size)) {
|
||||
if (this.override) {
|
||||
if ((contentLength !== null && contentLength !== BigInt(size)) || this.override) {
|
||||
await this.operator.delete(key);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user