<commit_before>var Step = require('step'),
    fs = require('fs'),
    path = require('path'),
    exec = require('child_process').exec,
    spawn = require('child_process').spawn,
    settings = Bones.plugin.config;

// @TODO: need a queue system. Difficult to manage atm because process
// completion is now determined outside this process.
// See http://en.wikipedia.org/wiki/SIGCHLD ... may be useful for determining
// when a child process has died and can be removed from the pool.
var start = function(model, data, callback) {
    if (data.status === 'waiting') {
        var args = [];
        // nice the export process.
        args.push('-n19');
        // path to node bin.
        args.push(process.execPath);
        // tilemill index.js
        args.push(path.resolve(path.join(__dirname + '/../index.js')));
        // export command
        args.push('export');
        // datasource
        args.push(data.project);
        // filepath
        args.push(path.join(settings.files, 'export', data.filename));
        // url, @TODO: need proper host info.
        args.push('--url=' + 'http://localhost:'+settings.port+'/api/Export/'+data.id);
        // Log crashes to output directory.
        args.push('--log');<commit_msg>Adjust export command parameters. Fixes #540.<commit_after>var Step = require('step'),
    fs = require('fs'),
    path = require('path'),
    exec = require('child_process').exec,
    spawn = require('child_process').spawn,
    settings = Bones.plugin.config;

// @TODO: need a queue system. Difficult to manage atm because process
// completion is now determined outside this process.
// See http://en.wikipedia.org/wiki/SIGCHLD ... may be useful for determining
// when a child process has died and can be removed from the pool.
var start = function(model, data, callback) {
    if (data.status === 'waiting') {
        var args = [];
        // nice the export process.
        args.push('-n19');
        // node command
        // @TODO note that process.execPath is not used here as certain
        // installs (e.g. ubuntu node ppa) do not use `node` as the binary
        // name causing optimist arg parsing to fail.
        args.push('node');
        // tilemill index.js
        args.push(path.resolve(path.join(__dirname + '/../index.js')));
        // export command
        args.push('export');
        // datasource
        args.push(data.project);
        // filepath
        args.push(path.join(settings.files, 'export', data.filename));
        // url, @TODO: need proper host info.
        args.push('--url=http://localhost:'+settings.port+'/api/Export/'+data.id);
        // Log crashes to output directory.
        args.push('--log=1');
{'fraction_non_alphanumeric': 0.14894405335309374, 'fraction_numerical': 0.0029640607632456465, 'mean_word_length': 2.4005037783375314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2332103', 'n_tokens_mistral': 768, 'n_tokens_neox': 760, 'n_words': 226}