Fix usage of execSync
important thing is to not use encoding: 'utf8' because in that case it will return a string instead of a Buffer object. '' is false but Buffer() is not.
This commit is contained in:
@@ -284,8 +284,7 @@ function testConfig(apiConfig, callback) {
|
||||
}
|
||||
|
||||
if (apiConfig.provider === PROVIDER_MOUNTPOINT) {
|
||||
safe.child_process.execSync(`mountpoint -q -- ${apiConfig.mountPoint}`, { encoding: 'utf8' });
|
||||
if (safe.error) return callback(new BoxError(BoxError.BAD_FIELD, `${apiConfig.mountPoint} is not mounted`, { field: 'mountPoint' }));
|
||||
if (!safe.child_process.execSync(`mountpoint -q -- ${apiConfig.mountPoint}`)) return callback(new BoxError(BoxError.BAD_FIELD, `${apiConfig.mountPoint} is not mounted`, { field: 'mountPoint' }));
|
||||
}
|
||||
|
||||
const backupPath = getBackupPath(apiConfig);
|
||||
|
||||
Reference in New Issue
Block a user