#22: Display error if daemon version is too low

This commit is contained in:
Scott E. Graves
2019-05-24 12:38:31 -05:00
parent 200534dccd
commit 234785180a
3 changed files with 79 additions and 7 deletions

View File

@@ -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,