Comparing version 0.1.0 to 0.1.1
13
flite.js
@@ -29,2 +29,3 @@ var child = require('child_process'); | ||
function detectFeatures(cb) { | ||
var usage = /usage/i; | ||
child.exec('flite --version', function (err, stdout) { | ||
@@ -40,5 +41,5 @@ dep.flite = /flite-1\.4/.test(stdout); | ||
child.exec('aplay --help', function (err, stdout, stderr) { | ||
dep.aplay = /usage/i.test(stderr); | ||
dep.aplay = usage.test(stderr) || usage.test(stdout); | ||
child.exec('afplay --help', function (err, stdout, stderr) { | ||
dep.afplay = /usage/i.test(stderr); | ||
dep.afplay = usage.test(stderr) || usage.test(stdout); | ||
@@ -70,3 +71,3 @@ dep.init = true; | ||
if (!cb) { | ||
cb = fileout; | ||
cb = fileout || noop; | ||
fileout = null; | ||
@@ -124,6 +125,8 @@ } | ||
var escapeshell = function(cmd) { | ||
function escapeshell(cmd) { | ||
return '"'+cmd.replace(/(["\s'$`\\])/g,'\\$1')+'"'; | ||
}; | ||
} | ||
function noop() {} | ||
module.exports = init; |
{ | ||
"name": "flite", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "binding for flite, a tiny text-to-speech synthesizer", | ||
@@ -5,0 +5,0 @@ "main": "flite.js", |
5290
117