Add check for mpd executable

Fixes Specific Issue #114
This commit is contained in:
Dave C-J 2013-12-12 20:49:25 +00:00
parent f8ed9cebeb
commit f8d57e672a
1 changed files with 7 additions and 0 deletions

View File

@ -15,7 +15,14 @@
**/
var RED = require(process.env.NODE_RED_HOME+"/red/red");
var exec = require('child_process').exec;
var komponist = require('komponist');
exec("which mpd",function(err,stdout,stderr) {
if (stdout.indexOf('mpd') == -1) {
util.log('[69-mpd.js] Error: Cannot find "mpd" command. Please install MPD.');
return;
}
});
var mpc = "";
komponist.createConnection(6600, 'localhost', function(err, client) {