Skip to content

Commit

Permalink
fix(copy-to-folder): error when copy to a folder with a dot (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
moshfeu authored Jan 17, 2024
1 parent 0779932 commit e285e71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/providers/foldersCompareProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ export class CompareFoldersProvider implements TreeDataProvider<File> {
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);
Expand Down

0 comments on commit e285e71

Please sign in to comment.