From cd6f35276331f5ff8b73dbd88443f7f0952b6cc8 Mon Sep 17 00:00:00 2001 From: Steffen Leistner Date: Wed, 25 Jan 2023 15:54:53 +0100 Subject: [PATCH] fix(RenameFileController): always append base path --- src/controller/RenameFileController.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controller/RenameFileController.ts b/src/controller/RenameFileController.ts index 70e9dc6c..29c1a231 100644 --- a/src/controller/RenameFileController.ts +++ b/src/controller/RenameFileController.ts @@ -6,6 +6,11 @@ export class RenameFileController extends MoveFileController { protected async getTargetPath(sourcePath: string, options: DialogOptions): Promise { const { prompt } = options; const value = path.basename(sourcePath); - return await this.showTargetPathInputBox({ prompt, value }); + const targetPath = await this.showTargetPathInputBox({ prompt, value }); + + if (targetPath) { + const basePath = path.dirname(sourcePath); + return path.join(basePath, targetPath.replace(basePath, "")); + } } }