<commit_before>import { ipcMain } from 'electron';
import childProcess from 'child_process';
import browsersync from 'browser-sync';
import sitesStore from './sites-store';
import siteController from './site-controller';
import path from 'path';

var jekyllDist = require('electron').app.getAppPath() + '/jekyll/jekyll';
var usedPorts = []; // Will fill with active servers' used ports

exports.newServer = function(requester, id, path) {
  var port = firstAvailablePort();
  var server = {
    siteID : id,
    localPath: path,
    reportTo : requester,
    process : (startServer(path, port)),
    bsProcess : browsersync.create(),
    port : port,
    localURL : undefined
  };

  server.process.stdout.on('data',
    function (data) {
      serverUpdate(server, data);
    }
  );

  return server;
}

exports.createNewSite = function(requester, dir) {
  var creatorProcess = childProcess.spawn(jekyllDist, ["new", dir]);
  creatorProcess.stdout.on('data',<commit_msg>Remove hardcoded slashes<commit_after>import { ipcMain } from 'electron';
import childProcess from 'child_process';
import browsersync from 'browser-sync';
import sitesStore from './sites-store';
import siteController from './site-controller';
import path from 'path';

var jekyllDist = path.join(require('electron').app.getAppPath(), "jekyll", "jekyll");
var usedPorts = []; // Will fill with active servers' used ports

exports.newServer = function(requester, id, path) {
  var port = firstAvailablePort();
  var server = {
    siteID : id,
    localPath: path,
    reportTo : requester,
    process : (startServer(path, port)),
    bsProcess : browsersync.create(),
    port : port,
    localURL : undefined
  };

  server.process.stdout.on('data',
    function (data) {
      serverUpdate(server, data);
    }
  );

  return server;
}

exports.createNewSite = function(requester, dir) {
  var creatorProcess = childProcess.spawn(jekyllDist, ["new", dir]);
  creatorProcess.stdout.on('data',
{'fraction_non_alphanumeric': 0.13435114503816795, 'fraction_numerical': 0.0, 'mean_word_length': 4.2287234042553195, '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': '4010498', 'n_tokens_mistral': 600, 'n_tokens_neox': 584, 'n_words': 156}