4 TABS
This commit is contained in:
parent
1a62f1dd8e
commit
b874e999ab
@ -17,10 +17,10 @@ export class FileStorage implements Storage {
|
|||||||
|
|
||||||
async set(path: string, value: any) {
|
async set(path: string, value: any) {
|
||||||
path = join(process.env.STORAGE_LOCATION || "", path).replace(/[\\]/g, "/");
|
path = join(process.env.STORAGE_LOCATION || "", path).replace(/[\\]/g, "/");
|
||||||
const dir = path.split("/").slice(0, -1).join("/");
|
const dir = path.split("/").slice(0, -1).join("/");
|
||||||
await fs.mkdir(dir, { recursive: true }).caught();
|
await fs.mkdir(dir, { recursive: true }).caught();
|
||||||
|
|
||||||
return fs.writeFile(path, value, { encoding: "binary" });
|
return fs.writeFile(path, value, { encoding: "binary" });
|
||||||
}
|
}
|
||||||
|
|
||||||
async delete(path: string) {
|
async delete(path: string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user