fix(core): update

This commit is contained in:
2024-06-09 16:02:33 +02:00
parent 559e3da47b
commit 591c99736d
4 changed files with 25 additions and 6 deletions

View File

@@ -74,8 +74,9 @@ export class Directory {
return null;
}
if (!exists && optionsArg.createWithContents) {
await this.fastPut({
path: optionsArg.name,
await File.create({
directory: this,
name: optionsArg.name,
contents: optionsArg.createWithContents,
});
}
@@ -254,6 +255,20 @@ export class Directory {
return result;
}
/**
* fast put stream
*/
public async fastPutStream(optionsArg: {
path: string;
stream: plugins.stream.Readable;
}): Promise<void> {
const path = plugins.path.join(this.getBasePath(), optionsArg.path);
await this.bucketRef.fastPutStream({
path,
readableStream: optionsArg.stream,
});
}
/**
* removes a file within the directory
* @param optionsArg