Skip to content

Commit

Permalink
fix(RenameFileController): always append base path
Browse files Browse the repository at this point in the history
  • Loading branch information
sleistner committed Jan 25, 2023
1 parent 3390544 commit cd6f352
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/controller/RenameFileController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export class RenameFileController extends MoveFileController {
protected async getTargetPath(sourcePath: string, options: DialogOptions): Promise<string | undefined> {
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, ""));
}
}
}

0 comments on commit cd6f352

Please sign in to comment.