#22: Display error if daemon version is too low
This commit is contained in:
@@ -16,6 +16,34 @@ const tryParse = (j, def) => {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.checkDaemonVersion = (directory, version, storageType) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const processOptions = {
|
||||
detached: true,
|
||||
shell: false,
|
||||
windowsHide: true,
|
||||
};
|
||||
|
||||
const command = path.join(directory, version, (os.platform() === 'win32') ? 'repertory.exe' : 'repertory');
|
||||
const args = [];
|
||||
args.push('-cv');
|
||||
if (Constants.PROVIDER_ARG[storageType.toLowerCase()].length > 0) {
|
||||
args.push(Constants.PROVIDER_ARG[storageType.toLowerCase()]);
|
||||
}
|
||||
|
||||
const process = new spawn(command, args, processOptions);
|
||||
|
||||
process.on('error', err => {
|
||||
reject(err);
|
||||
});
|
||||
|
||||
process.on('exit', code => {
|
||||
resolve(code);
|
||||
});
|
||||
process.unref();
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.createSignatureFiles = (signature, publicKey) => {
|
||||
const fileName1 = RandomString.generate({
|
||||
length: 12,
|
||||
|
||||
Reference in New Issue
Block a user