fixed abiword on windows

This commit is contained in:
Peter 'Pita' Martischka 2011-08-13 13:02:27 +01:00
parent a5b84f1b6e
commit 5252bee124
1 changed files with 4 additions and 2 deletions

View File

@ -24,12 +24,14 @@ var async = require("async");
var settings = require("./Settings"); var settings = require("./Settings");
var os = require('os'); var os = require('os');
var doConvertTask;
//on windows we have to spawn a process for each convertion, cause the plugin abicommand doesn't exist on this platform //on windows we have to spawn a process for each convertion, cause the plugin abicommand doesn't exist on this platform
if(os.type().indexOf("Windows") > -1) if(os.type().indexOf("Windows") > -1)
{ {
var stdoutBuffer = ""; var stdoutBuffer = "";
function doConvertTask(task, callback) doConvertTask = function(task, callback)
{ {
//span an abiword process to perform the conversion //span an abiword process to perform the conversion
var abiword = spawn(settings.abiword, ["--to=" + task.destFile, task.srcFile]); var abiword = spawn(settings.abiword, ["--to=" + task.destFile, task.srcFile]);
@ -123,7 +125,7 @@ else
} }
} }
function doConvertTask(task, callback) doConvertTask = function(task, callback)
{ {
abiword.stdin.write("convert " + task.srcFile + " " + task.destFile + " " + task.type + "\n"); abiword.stdin.write("convert " + task.srcFile + " " + task.destFile + " " + task.type + "\n");