Skip to content

Commit

Permalink
updated temp file removal
Browse files Browse the repository at this point in the history
Signed-off-by: Pujal <pujal.gandhi@broadcom.com>
  • Loading branch information
pujal0909 committed Feb 12, 2025
1 parent dd84ed7 commit c62d262
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/zosfiles/src/methods/copy/Copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,17 @@ export class Copy {
continue;
}
}
const truncatedMembersFile = path.join(tmpdir(), 'truncatedMembers.txt');
if(truncatedMembers.length > 0) {
const errorMembersFile = path.join(tmpdir(), 'errorMembers.txt');
fs.writeFileSync(errorMembersFile, truncatedMembers.join('\n'));
fs.writeFileSync(truncatedMembersFile, truncatedMembers.join('\n'));
return {
success: true,
commandResponse: ZosFilesMessages.datasetCopiedSuccessfully.message + " " +
util.format(ZosFilesMessages.membersContentTruncated.message, errorMembersFile)
util.format(ZosFilesMessages.membersContentTruncated.message, truncatedMembersFile)
};
}
fs.rmSync(downloadDir, {recursive: true});
fs.rmSync(truncatedMembersFile);
return {
success:true,
commandResponse: ZosFilesMessages.datasetCopiedSuccessfully.message
Expand Down

0 comments on commit c62d262

Please sign in to comment.