From f8d57e672a481f5f03421622b7090e2fc2e958d8 Mon Sep 17 00:00:00 2001 From: Dave C-J Date: Thu, 12 Dec 2013 20:49:25 +0000 Subject: [PATCH] Add check for mpd executable Fixes Specific Issue #114 --- social/music/69-mpd.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/social/music/69-mpd.js b/social/music/69-mpd.js index 298d4cf4..659f625b 100644 --- a/social/music/69-mpd.js +++ b/social/music/69-mpd.js @@ -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) {