diff --git a/package.json b/package.json index 7354b86..4917b39 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "compare-folders", "displayName": "Compare Folders", "description": "Compare folders by contents, present the files that have differences and display the diffs side by side", - "version": "0.24.1", + "version": "0.24.2", "repository": { "type": "git", "url": "https://github.com/moshfeu/vscode-compare-folders" diff --git a/src/providers/foldersCompareProvider.ts b/src/providers/foldersCompareProvider.ts index d55a7a4..3580394 100644 --- a/src/providers/foldersCompareProvider.ts +++ b/src/providers/foldersCompareProvider.ts @@ -256,9 +256,9 @@ export class CompareFoldersProvider implements TreeDataProvider { const [folder1Path, folder2Path] = pathContext.getPaths(); const [from, to] = direction === 'to-compared' ? [folder1Path, folder2Path] : [folder2Path, folder1Path]; - const { root, dir, name } = path.parse(from); + const { root, dir, base } = path.parse(from); const pathWithoutSchema = dir.replace(root, ''); - const fileCopiedRelativePath = uri.fsPath.replace(pathWithoutSchema, '').replace(name, ''); + const fileCopiedRelativePath = uri.fsPath.replace(pathWithoutSchema, '').replace(base, ''); const fromPath = path.join(from, fileCopiedRelativePath); const toPath = path.join(to, fileCopiedRelativePath); copySync(fromPath, toPath);