2019-01-09 12:45:37 +00:00
|
|
|
var commandExistsSync = require('command-exists').sync;
|
2019-01-09 14:32:19 +00:00
|
|
|
var app = require('electron').app;
|
2019-01-09 12:45:37 +00:00
|
|
|
|
|
|
|
exports.getInstalledSoftware = (softwareList) => {
|
|
|
|
const installed = {};
|
|
|
|
for(var software of softwareList) {
|
|
|
|
var name = software.name;
|
|
|
|
var commands = software.commands;
|
|
|
|
|
|
|
|
installed[name] = [];
|
|
|
|
|
|
|
|
for(var command of commands) {
|
|
|
|
var exists = commandExistsSync(command);
|
|
|
|
if(exists) {
|
|
|
|
installed[name].push(command);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return installed;
|
|
|
|
}
|
|
|
|
|
2019-01-09 14:32:19 +00:00
|
|
|
exports.install = (software) => {
|
|
|
|
var type = software.type;
|
|
|
|
|
|
|
|
if (type == 'web') {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(app.getAppPath());
|
|
|
|
}
|