<commit_before>const fs = require('fs');
const path = require('path');

move(getMovePaths('webpack.config.js'), log);
move(getMovePaths('.babelrc'), log);
move(getMovePaths('tns'), log);

symlinkFromTns('package.json', 'file');
symlinkFromTns('package-lock.json', 'file');
symlinkFromTns('node-modules', 'dir');
symlinkFromTns('app/App_Resources', 'dir');
symlinkFromTns('app/images', 'dir');

fs.unlinkSync('postinstall.js');

function getMovePaths(movingFile) {
  return {
    oldPath: path.join(__dirname, movingFile),
    newPath: path.join(__dirname, '..', '..', movingFile)
  }
}

function log(err) {
  if (err) {
    console.log(err);
  }
}

function symlinkFromTns(file, type) {
  fs.symlinkSync(
    path.join(__dirname, '..', '..', 'tns', file),
    path.join(__dirname, '..', '..', file),
    type);
}

// move function copied from: https://stackoverflow.com/questions/8579055/how-i-move-files-on-node-js
function move({ oldPath, newPath }, callback) {
  fs.rename(oldPath, newPath, function (err) {
    if (err) {<commit_msg>Fix removing file.<commit_after>const fs = require('fs');
const path = require('path');

move(getMovePaths('webpack.config.js'), log);
move(getMovePaths('.babelrc'), log);
move(getMovePaths('tns'), log);

symlinkFromTns('package.json', 'file');
symlinkFromTns('package-lock.json', 'file');
symlinkFromTns('node-modules', 'dir');
symlinkFromTns('app/App_Resources', 'dir');
symlinkFromTns('app/images', 'dir');

fs.unlinkSync('postinstall.js');

function getMovePaths(movingFile) {
  return {
    oldPath: path.join(__dirname, movingFile),
    newPath: path.join(__dirname, '..', '..', movingFile)
  }
}

function log(err) {
  if (err) {
    console.log(err);
  }
}

function symlinkFromTns(file, type) {
  if (fs.existsSync(path.join(__dirname, '..', '..', 'tns', file))) {
    fs.unlinkSync(path.join(__dirname, '..', '..', 'tns', file));
  }
  fs.symlinkSync(
    path.join(__dirname, '..', '..', 'tns', file),
    path.join(__dirname, '..', '..', file),
    type);
}

// move function copied from: https://stackoverflow.com/questions/8579055/how-i-move-files-on-node-js
function move({ oldPath, newPath }, callback) {
  fs.rename(oldPath, newPath, function (err) {
    if (err) {
{'fraction_non_alphanumeric': 0.20910319963947724, 'fraction_numerical': 0.006309148264984227, 'mean_word_length': 4.70694087403599, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1403075', 'n_tokens_mistral': 810, 'n_tokens_neox': 799, 'n_words': 135}