<commit_before>const { readdir } = require('fs-extra');
const { resolve } = require('path');
const { cd, exec, grep, mkdir, mv, rm } = require('shelljs');


const electronUrl = 'https://atom.io/download/electron';
const electronVersion = grep('"electron":', 'package.json')
	.sed(/[ ]+"electron": "[\^]?(.*)"[,]?/, '$1')
	.replace(/\n/, '');

mkdir('-p', 'modules');
cd('sources/modules');

readdir(resolve()).then((modules) => {
	for (const module of modules) {
		cd(module);
		exec(`../../../node_modules/.bin/node-gyp rebuild --target=${electronVersion} --arch=x64 --dist-url=${electronUrl}`);
		mv(`build/Release/${module}.node`, '../../../modules');
		rm('-r', 'build');
		cd('-');
		console.log(`${module} build completed.`);<commit_msg>Try to fix script<commit_after>const { readdir } = require('fs-extra');
const { resolve } = require('path');
const { cd, exec, grep, mkdir, mv, rm } = require('shelljs');


const electronUrl = 'https://atom.io/download/electron';
const electronVersion = grep('"electron":', 'package.json')
	.sed(/[ ]+"electron": "[\^]?(.*)"[,]?/, '$1')
	.replace(/\n/, '');

mkdir('-p', 'modules');
cd('sources/modules');

readdir(resolve()).then((modules) => {
	for (const module of modules) {
		cd(module);
		exec(`${resolve('../../../node_modules/.bin/node-gyp')} rebuild --target=${electronVersion} --arch=x64 --dist-url=${electronUrl}`);
		mv(`build/Release/${module}.node`, '../../../modules');
		rm('-r', 'build');
		cd('-');
		console.log(`${module} build completed.`);
{'fraction_non_alphanumeric': 0.28257978723404253, 'fraction_numerical': 0.003989361702127659, 'mean_word_length': 4.413669064748201, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7625847', 'n_tokens_mistral': 545, 'n_tokens_neox': 514, 'n_words': 98}