mirror of
https://github.com/docmost/docmost.git
synced 2025-11-10 05:02:06 +10:00
fix local storage copy function (#1442)
This commit is contained in:
@ -40,8 +40,11 @@ export class LocalDriver implements StorageDriver {
|
||||
|
||||
async copy(fromFilePath: string, toFilePath: string): Promise<void> {
|
||||
try {
|
||||
const fromFullPath = this._fullPath(fromFilePath);
|
||||
const toFullPath = this._fullPath(toFilePath);
|
||||
|
||||
if (await this.exists(fromFilePath)) {
|
||||
await fs.copy(fromFilePath, toFilePath);
|
||||
await fs.copy(fromFullPath, toFullPath);
|
||||
}
|
||||
} catch (err) {
|
||||
throw new Error(`Failed to copy file: ${(err as Error).message}`);
|
||||
|
||||
Reference in New Issue
Block a user