File size: 550 Bytes
23a3b80
6e78e38
23a3b80
6e78e38
23a3b80
 
 
 
 
 
 
 
 
 
 
 
6e78e38
23a3b80
 
 
6e78e38
23a3b80
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { AbstractTempFileManger } from 'civkit/temp';
import { rm } from 'fs/promises';
import { singleton } from 'tsyringe';
import { Finalizer } from './finalizer';

@singleton()
export class TempFileManager extends AbstractTempFileManger {

    rootDir = '';

    override async init() {
        await this.dependencyReady();
        await super.init();
        this.emit('ready');
    }

    @Finalizer()
    override async standDown() {
        await super.standDown();

        await rm(this.rootDir, { recursive: true, force: true });
    }
}