<commit_before>/**
*
* Copyright © 2014-2016 killanaca All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*
*/

import ncp from 'ncp';
import del from 'del';
import path from 'path';

async function postinstall() {
	// this is the path of the package: ..../node_modules/deployment-tools
	const packagePath = process.cwd();
	const src = path.join(packagePath, 'dist');
	const projectPath = path.join(packagePath, '../../');
	const destPath = path.join(projectPath, 'tools');
	console.log('src', src, 'projectPath', projectPath, 'destPath', destPath);
	// first delete folder
	await del(destPath, { dot: true, dryRun: true, force: true });
	// then copy dist into projects tools folder
	ncp(src, destPath, (err) => {
		if (err) {
			return console.error(err);
		}
		return console.log('done!');
	});
}

export default postinstall;<commit_msg>chore(postinstall): use the async version of ncp<commit_after>/**
*
* Copyright © 2014-2016 killanaca All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*
*/

import ncp from 'ncp';
import del from 'del';
import path from 'path';
import logger from './libs/logger';
import { promisify } from 'bluebird';

async function postinstall() {
	const ncpAsync = promisify(ncp);
	// this is the path of the package: ..../node_modules/deployment-tools
	const packagePath = process.cwd();
	const src = path.join(packagePath, 'dist');
	const projectPath = path.join(packagePath, '../../');
	const destPath = path.join(projectPath, 'tools');
	logger.log('postinstall try to copy files from src', src, 'to destPath', destPath);
	// first delete folder
	await del(destPath, { dot: true, dryRun: true, force: true });
	// then copy dist into projects tools folder
	await ncpAsync(src, destPath);
	logger.log('postinstall copied files from src', src, 'to destPath', destPath);
}

export default postinstall;
{'fraction_non_alphanumeric': 0.13349753694581282, 'fraction_numerical': 0.007881773399014778, 'mean_word_length': 4.344736842105263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2803932', 'n_tokens_mistral': 633, 'n_tokens_neox': 616, 'n_words': 230}