mirror of
https://github.com/cupcakearmy/morphus.git
synced 2024-12-21 23:56:27 +00:00
create bucket if not exists
This commit is contained in:
parent
5c669bcce9
commit
ec67bd8f0a
@ -26,7 +26,11 @@ export class Minio implements Storage {
|
||||
}
|
||||
|
||||
async init(): Promise<void> {
|
||||
await this.client.bucketExists(this.options.bucket)
|
||||
const exists = await this.client.bucketExists(this.options.bucket)
|
||||
if (!exists) {
|
||||
// @ts-ignore
|
||||
await this.client.makeBucket(this.options.bucket)
|
||||
}
|
||||
}
|
||||
|
||||
async readStream(path: string): Promise<NodeJS.ReadableStream> {
|
||||
|
Loading…
Reference in New Issue
Block a user