From 9b926fbad6c40a2e3792cc0d7c54987febd6dced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Tue, 17 Jan 2023 10:07:01 +0100 Subject: [PATCH] fix(syncing-server-js): creating directory for revision dumps --- packages/syncing-server/src/Infra/FS/FSItemBackupService.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/syncing-server/src/Infra/FS/FSItemBackupService.ts b/packages/syncing-server/src/Infra/FS/FSItemBackupService.ts index ce88c5a71..42bbffdd0 100644 --- a/packages/syncing-server/src/Infra/FS/FSItemBackupService.ts +++ b/packages/syncing-server/src/Infra/FS/FSItemBackupService.ts @@ -3,6 +3,7 @@ import { promises } from 'fs' import * as uuid from 'uuid' import { inject, injectable } from 'inversify' import { Logger } from 'winston' +import { dirname } from 'path' import TYPES from '../../Bootstrap/Types' import { Item } from '../../Domain/Item/Item' @@ -31,6 +32,8 @@ export class FSItemBackupService implements ItemBackupServiceInterface { this.logger.debug(`Dumping item ${item.uuid} to ${path}`) + await promises.mkdir(dirname(path), { recursive: true }) + await promises.writeFile(path, contents) return path