Skip to content

Commit

Permalink
Fix removing (temp) IFS directories
Browse files Browse the repository at this point in the history
  • Loading branch information
chrjorgensen committed Feb 14, 2024
1 parent 9961d31 commit 8d661ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/api/IBMi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export default class IBMi {
})

this.sendCommand({
command: `rm -f ${path.posix.join(this.config.tempDir, `vscodetemp*`)}`
command: `rm -rf ${path.posix.join(this.config.tempDir, `vscodetemp*`)}`
})
.then(result => {
// All good!
Expand Down
6 changes: 3 additions & 3 deletions src/api/IBMiContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default class IBMiContent {
switch (messageID) {
case "CPDA08A":
//We need to try again after we delete the temp remote
const result = await this.ibmi.sendCommand({ command: `rm -f ${tempRmt}`, directory: `.` });
const result = await this.ibmi.sendCommand({ command: `rm -rf ${tempRmt}`, directory: `.` });
retry = !result.code || result.code === 0;
break;
case "CPFA0A9":
Expand Down Expand Up @@ -345,7 +345,7 @@ export default class IBMiContent {

if (this.config.autoClearTempData) {
Promise.allSettled([
this.ibmi.sendCommand({ command: `rm -f ${tempRmt}`, directory: `.` }),
this.ibmi.sendCommand({ command: `rm -rf ${tempRmt}`, directory: `.` }),
deleteTable ? this.ibmi.runCommand({ command: `DLTOBJ OBJ(${library}/${file}) OBJTYPE(*FILE)`, noLibList: true }) : Promise.resolve()
]);
}
Expand Down Expand Up @@ -401,7 +401,7 @@ export default class IBMiContent {
}
finally {
if (this.config.autoClearTempData && temporaryFile) {
await this.ibmi.sendCommand({ command: `rm -f ${temporaryFile}` });
await this.ibmi.sendCommand({ command: `rm -rf ${temporaryFile}` });
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/local/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export namespace Deployment {
export async function deleteFiles(parameters: DeploymentParameters, toDelete: string[]) {
if (toDelete.length) {
Deployment.deploymentLog.appendLine(`\nDeleted:\n\t${toDelete.join('\n\t')}\n`);
await Deployment.getConnection().sendCommand({ directory: parameters.remotePath, command: `rm -f ${toDelete.join(' ')}` });
await Deployment.getConnection().sendCommand({ directory: parameters.remotePath, command: `rm -rf ${toDelete.join(' ')}` });
}
}

Expand Down

0 comments on commit 8d661ff

Please sign in to comment.