|
|
@ -32,12 +32,13 @@ module.exports = function(content, map, meta) { |
|
|
|
if (options.expr) |
|
|
|
if (options.expr) |
|
|
|
expr = options.expr; |
|
|
|
expr = options.expr; |
|
|
|
expr = expr.replace('SXML_LOADER_CONTENT', content); |
|
|
|
expr = expr.replace('SXML_LOADER_CONTENT', content); |
|
|
|
|
|
|
|
chdir(this.rootContext); |
|
|
|
|
|
|
|
|
|
|
|
const cb = this.async(); |
|
|
|
const cb = this.async(); |
|
|
|
runScheme('guile', ['-c', expr]).then(data => { |
|
|
|
runScheme('guile', ['-c', expr]).then(data => { |
|
|
|
cb(null, `${doctype}\n${data}`, map, meta); |
|
|
|
cb(null, `${doctype}\n${data}`, map, meta); |
|
|
|
}).catch(err => { |
|
|
|
}).catch(code => { |
|
|
|
console.error(err); |
|
|
|
console.error(`Guile exited with code ${code}`); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -49,7 +50,11 @@ function runScheme(interpreter, flags) { |
|
|
|
resolve(data); |
|
|
|
resolve(data); |
|
|
|
}); |
|
|
|
}); |
|
|
|
scheme.stderr.on('data', (data) => { |
|
|
|
scheme.stderr.on('data', (data) => { |
|
|
|
reject(data.toString()); |
|
|
|
console.error(data.toString()); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
scheme.on('exit', (code) => { |
|
|
|
|
|
|
|
if (code) |
|
|
|
|
|
|
|
reject(code); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|