mirror of
https://github.com/easingthemes/ssh-deploy.git
synced 2024-11-13 22:38:04 +00:00
feat: apply deleteFile function to remoteCmd
This commit is contained in:
parent
1befdb1c6b
commit
b82eced457
@ -1,7 +1,7 @@
|
|||||||
const { exec } = require('child_process');
|
const { exec } = require('child_process');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const { sshServer, githubWorkspace, remotePort } = require('./inputs');
|
const { sshServer, githubWorkspace, remotePort } = require('./inputs');
|
||||||
const { writeToFile } = require('./helpers');
|
const { writeToFile, deleteFile } = require('./helpers');
|
||||||
|
|
||||||
const handleError = (message, isRequired, callback) => {
|
const handleError = (message, isRequired, callback) => {
|
||||||
if (isRequired) {
|
if (isRequired) {
|
||||||
@ -30,6 +30,8 @@ const remoteCmd = async (content, privateKeyPath, isRequired, label) => new Prom
|
|||||||
} else {
|
} else {
|
||||||
const limited = data.substring(0, dataLimit);
|
const limited = data.substring(0, dataLimit);
|
||||||
console.log('✅ [CMD] Remote script executed. \n', limited, stderr);
|
console.log('✅ [CMD] Remote script executed. \n', limited, stderr);
|
||||||
|
deleteFile({ dir: githubWorkspace, filename });
|
||||||
|
console.log('✅ [FILE] Script file deleted.');
|
||||||
resolve(limited);
|
resolve(limited);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user