rsync check
This commit is contained in:
		
							parent
							
								
									11f58724d7
								
							
						
					
					
						commit
						5403dab9a0
					
				
							
								
								
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -3,9 +3,18 @@ const { exec, execSync } = require("child_process");
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const validateRsync = (callback = () => {}) => {
 | 
					const validateRsync = (callback = () => {}) => {
 | 
				
			||||||
  const rsyncCli = commandExists("rsync");
 | 
					  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');
 | 
					  console.log('⚠️ [CLI] Rsync doesn\'t exists. Start installation with "apt-get" \n');
 | 
				
			||||||
  if (!rsyncCli) {
 | 
					  try {
 | 
				
			||||||
    execSync("sudo apt-get update");
 | 
					    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) => {
 | 
					  exec("sudo apt-get --no-install-recommends install rsync", (err, data, stderr) => {
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
      console.log("⚠️ [CLI] Rsync installation failed. Aborting ... ", err.message);
 | 
					      console.log("⚠️ [CLI] Rsync installation failed. Aborting ... ", err.message);
 | 
				
			||||||
@ -15,9 +24,6 @@ const validateRsync = (callback = () => {}) => {
 | 
				
			|||||||
      callback();
 | 
					      callback();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  } else {
 | 
					 | 
				
			||||||
    callback();
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const validateInputs = (inputs) => {
 | 
					const validateInputs = (inputs) => {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user