<commit_before>/* eslint-disable no-console */
import rimraf from 'rimraf';
import fs from 'fs';
import chalk from 'chalk';

const pathsToRemove = [
  './src/actions/*',
  './src/components/*',
  './src/containers/*',
  './src/reducers/*',
  './src/fonts',
  './src/styles/globalStyles.js',
  './src/routes.js',
  './src/index.ejs',
  './tools/removeDemo.js'
];

const filesToCreate = [
  {
    path: './src/actions/actionTypes.js',
    content: '//Action types constants'
  },
  {
    path: './src/routes.js',
    content: '//Application routes declarations\nimport React from \'react\';\nimport { Route } from \'react-router\';\n\nimport App from \'./containers/App\';\n\nexport default (\n  <Route path="/" component={App}>\n  </Route>\n);'
  },
  {
    path: './src/reducers/initialState.js',
    content: '//Reducers\' default state'
  },
  {
    path: './src/reducers/index.js',
    content: '//Root reducer setup\nimport { combineReducers } from \'redux\';\nimport { routerReducer } from \'react-router-redux\';\n\nconst rootReducer = combineReducers({ routing: routerReducer });\n\nexport default rootReducer;'
  },
  {
    path: './src/styles/globalStyles.js',
    content: 'import { injectGlobal } from \'styled-components\';\n\ninjectGlobal\`\n\`;'
  },
  {
    path: './src/index.ejs',
    content: '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"><title>Custom React App</title></head><body><div id="app"></div></body></html>'
  },
  {
    path: './src/containers/App.js',
    content: '//Application root/wrapper component\nimport React from \'react\';\n\nclass App extends React.Component {\n  render() {\n    return (\n      <div></div>\n    );\n  }\n}\n\nexport default App;'
  }
];

function removePath(path, callback) {
  rimraf(path, error => {
    if (error) throw new Error(error);
    callback();
  });
}

function createFile(file) {
  fs.writeFile(file.path, file.content, error => {<commit_msg>removeDemo script updated<commit_after>/* eslint-disable no-console */
import rimraf from 'rimraf';
import fs from 'fs';
import chalk from 'chalk';

const pathsToRemove = [
  './src/actions/*',
  './src/components/*',
  './src/containers/*',
  './src/reducers/*',
  './src/sagas/*',
  './src/fonts',
  './src/styles/globalStyles.js',
  './src/routes.js',
  './src/index.ejs',
  './tools/removeDemo.js'
];

const filesToCreate = [
  {
    path: './src/actions/actionTypes.js',
    content: '// Action types constants'
  },
  {
    path: './src/routes.js',
    content: '// Application routes declarations\nimport React from \'react\';\nimport { Route } from \'react-router\';\n\nimport App from \'./containers/App\';\n\nexport default (\n  <Route path="/" component={App}>\n  </Route>\n);'
  },
  {
    path: './src/reducers/initialState.js',
    content: '// Reducers\' default state'
  },
  {
    path: './src/reducers/index.js',
    content: '// Root reducer setup\nimport { combineReducers } from \'redux\';\nimport { routerReducer } from \'react-router-redux\';\n\nconst rootReducer = combineReducers({ routing: routerReducer });\n\nexport default rootReducer;'
  },
  {
    path: './src/styles/globalStyles.js',
    content: 'import { injectGlobal } from \'styled-components\';\n\ninjectGlobal\`\n\`;'
  },
  {
    path: './src/index.ejs',
    content: '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"><title>Custom React App</title></head><body><div id="app"></div></body></html>'
  },
  {
    path: './src/containers/App.js',
    content: '// Application root/wrapper component\nimport React from \'react\';\n\nclass App extends React.Component {\n  render() {\n    return (\n      <div></div>\n    );\n  }\n}\n\nexport default App;'
  },
  {
    path: './src/sagas/defaultSaga.js',
    content: '// Default redux saga\nimport { fork } from \'redux-saga/effects\';\n\nexport function* dummySaga() {\n  yield;\n}\n\nexport default function* defaultSagas() {\n  yield [\n    fork(dummySaga)\n  ];\n}'
  },
  {
    path: './src/sagas/index.js',
    content: '// Root saga\nimport { fork } from \'redux-saga/effects\';\n\nimport defaultSaga from \'./defaultSaga\';\n\nexport default function* rootSaga() {\n  yield [\n    fork(defaultSaga)\n  ];\n}'
  }
];

function removePath(path, callback) {
  rimraf(path, error => {
    if (error) throw new Error(error);
    callback();
  });
}

function createFile(file) {
  fs.writeFile(file.path, file.content, error => {
{'fraction_non_alphanumeric': 0.20886634318482575, 'fraction_numerical': 0.000882223202470225, 'mean_word_length': 3.230410447761194, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 41, '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': '6302192', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1580, 'n_words': 319}