fix trashedFilePath returning relative path issue
This commit is contained in:
parent
ab50f27d87
commit
b3f9c1a1b4
|
@ -245,14 +245,15 @@ export const getTrashedFileExportPath = (exportDir: string, path: string) => {
|
||||||
let trashedFilePath = `${exportDir}/${ENTE_TRASH_FOLDER}/${fileRelativePath}`;
|
let trashedFilePath = `${exportDir}/${ENTE_TRASH_FOLDER}/${fileRelativePath}`;
|
||||||
let count = 1;
|
let count = 1;
|
||||||
while (exportService.exists(trashedFilePath)) {
|
while (exportService.exists(trashedFilePath)) {
|
||||||
const filenameParts = splitFilenameAndExtension(fileRelativePath);
|
const trashedFilePathParts = splitFilenameAndExtension(trashedFilePath);
|
||||||
if (filenameParts[1]) {
|
if (trashedFilePathParts[1]) {
|
||||||
trashedFilePath = `${filenameParts[0]}(${count}).${filenameParts[1]}`;
|
trashedFilePath = `${trashedFilePathParts[0]}(${count}).${trashedFilePathParts[1]}`;
|
||||||
} else {
|
} else {
|
||||||
trashedFilePath = `${filenameParts[0]}(${count})`;
|
trashedFilePath = `${trashedFilePathParts[0]}(${count})`;
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
console.log('trashedFilePath', trashedFilePath);
|
||||||
return trashedFilePath;
|
return trashedFilePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue