Skip to content

Commit

Permalink
feat: apply deleteFile function to remoteCmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Armadillidiid committed Mar 17, 2024
1 parent 1befdb1 commit b82eced
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/remoteCmd.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { exec } = require('child_process');
const crypto = require('crypto');
const { sshServer, githubWorkspace, remotePort } = require('./inputs');
const { writeToFile } = require('./helpers');
const { writeToFile, deleteFile } = require('./helpers');

const handleError = (message, isRequired, callback) => {
if (isRequired) {
Expand Down Expand Up @@ -30,6 +30,8 @@ const remoteCmd = async (content, privateKeyPath, isRequired, label) => new Prom
} else {
const limited = data.substring(0, dataLimit);
console.log('✅ [CMD] Remote script executed. \n', limited, stderr);
deleteFile({ dir: githubWorkspace, filename });
console.log('✅ [FILE] Script file deleted.');
resolve(limited);
}
}
Expand Down

0 comments on commit b82eced

Please sign in to comment.