Skip to content

Commit

Permalink
remove changes to DatasetFS rename
Browse files Browse the repository at this point in the history
Signed-off-by: Trae Yelovich <[email protected]>
  • Loading branch information
traeok committed Nov 18, 2024
1 parent 57cb760 commit ac466e1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/zowe-explorer/src/trees/dataset/DatasetFSProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,7 @@ export class DatasetFSProvider extends BaseProvider implements vscode.FileSystem
}

const entry = this.lookup(oldUri, false) as PdsEntry | DsEntry;
const oldParent = this._lookupParentDirectory(oldUri);
const newParent = this._lookupParentDirectory(newUri);
const parentDir = this._lookupParentDirectory(oldUri);

const oldName = entry.name;
const newName = path.posix.basename(newUri.path);
Expand Down Expand Up @@ -722,14 +721,14 @@ export class DatasetFSProvider extends BaseProvider implements vscode.FileSystem
throw err;
}

oldParent.entries.delete(entry.name);
parentDir.entries.delete(entry.name);
entry.name = newName;

// Build the new path using the previous path and new file/folder name.
const newPath = path.posix.join(entry.metadata.path, "..", newName);

entry.metadata.path = newPath;
newParent.entries.set(newName, entry);
parentDir.entries.set(newName, entry);

if (FsDatasetsUtils.isPdsEntry(entry)) {
for (const [_, member] of entry.entries) {
Expand Down

0 comments on commit ac466e1

Please sign in to comment.