<commit_before>// This script removes demo app files
import rimraf from 'rimraf';
import fs from 'fs';
import colors from 'colors';

/* eslint-disable no-console */

const pathsToRemove = [
  './source/modules/demo',
  './source/modules/header-presentation',
  './source/modules/github-button',
  './source/modules/header/*',
  './source/modules/logo/logo.js',
  './source/pages/home.pug',
  './source/static/assets/favicons/*',
  './source/static/assets/fonts/*',
  './source/static/assets/images/content/*',
  './source/static/assets/icons/*',
  './source/static/assets/sprite/*',
  './tools/removeDemo.js' // this file
];

const filesToCreate = [
  {
    path: './source/pages/home.pug',
    content:
`include ../modules/injected/injected
include ../modules/page/page

include ../modules/head/head
include ../modules/footer/footer
include ../modules/header/header

doctype html
html(class="no-js" lang=config.lang)

  head
    +head(head.home)

  +page()
    +inject('header')
      +header()

    +inject('main')
      h1 Home page

    +inject('footer')
      +footer()
`
  },
  {
    path: './source/modules/header/header.pug',
    content:
`mixin header(data)
  header.header&attributes(attributes)
    //-
`
  },
  {
    path: './source/modules/header/header.styl',
    content: '.header\n\t//\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 => {<commit_msg>Fix bug in remove demo<commit_after>// This script removes demo app files
import rimraf from 'rimraf';
import fs from 'fs';
import colors from 'colors';

/* eslint-disable no-console */

const pathsToRemove = [
  './source/modules/demo',
  './source/modules/header-presentation',
  './source/modules/github-button',
  './source/modules/header/*',
  './source/modules/logo/logo.js',
  './source/pages/home.pug',
  './source/static/assets/favicons/*',
  './source/static/assets/fonts/*',
  './source/static/assets/images/content/*',
  './source/static/assets/icons/*',
  './source/static/assets/sprite/*',
  './tools/removeDemo.js' // this file
];

const filesToCreate = [
  {
    path: './source/pages/home.pug',
    content:
`include ../modules/injected/injected
include ../modules/page/page

include ../modules/head/head
include ../modules/footer/footer
include ../modules/header/header

doctype html
html(class="no-js" lang=config.lang)

	head
		+head(head.home)

	+page()
		+inject('header')
			+header()

		+inject('main')
			h1 Home page

		+inject('footer')
			+footer()
`
  },
  {
    path: './source/modules/header/header.pug',
    content:
`mixin header(data)
	header.header&attributes(attributes)
		//-
`
  },
  {
    path: './source/modules/header/header.styl',
    content: '.header\n\t//\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.19088225647753362, 'fraction_numerical': 0.0006559527714004591, 'mean_word_length': 3.1271989174560217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3700180', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1050, 'n_words': 190}