mirror of
https://github.com/easingthemes/ssh-deploy.git
synced 2025-06-21 20:12:10 +10:00
simple command exists
This commit is contained in:
parent
8e3c961ec3
commit
6e50b54a1b
4 changed files with 15 additions and 32 deletions
|
@ -1,11 +1,16 @@
|
|||
const { execSync } = require('child_process');
|
||||
const which = require('which');
|
||||
const nodeRsync = require('rsyncwrapper');
|
||||
|
||||
// eslint-disable-next-line no-async-promise-executor
|
||||
const validateRsync = new Promise(async (resolve, reject) => {
|
||||
const rsyncCli = await which('rsync', { nothrow: true });
|
||||
execSync('rsync --version', { stdio: 'inherit' });
|
||||
let rsyncCli = false;
|
||||
try {
|
||||
execSync('rsync --version', { stdio: 'inherit' });
|
||||
rsyncCli = true;
|
||||
} catch (e) {
|
||||
rsyncCli = true;
|
||||
}
|
||||
|
||||
if (rsyncCli) {
|
||||
console.log('⚠️ [CLI] Rsync exists');
|
||||
execSync('rsync --version', { stdio: 'inherit' });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue