rsync check

main
Dragan Filipovic 2022-12-31 10:00:32 +01:00
parent 11f58724d7
commit 5403dab9a0
2 changed files with 21 additions and 15 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -3,9 +3,18 @@ const { exec, execSync } = require("child_process");
const validateRsync = (callback = () => {}) => {
const rsyncCli = commandExists("rsync");
if (rsyncCli) {
console.log('⚠️ [CLI] Rsync exists', execSync("rsync --version"));
return callback();
}
console.log('⚠️ [CLI] Rsync doesn\'t exists. Start installation with "apt-get" \n');
if (!rsyncCli) {
try {
execSync("sudo apt-get update");
} catch (e) {
console.log( "⚠️ [CLI] Cant run . apt-get update. Skipping ...". e.message);
}
exec("sudo apt-get --no-install-recommends install rsync", (err, data, stderr) => {
if (err) {
console.log("⚠️ [CLI] Rsync installation failed. Aborting ... ", err.message);
@ -15,9 +24,6 @@ const validateRsync = (callback = () => {}) => {
callback();
}
});
} else {
callback();
}
};
const validateInputs = (inputs) => {