<commit_before>// Copyright 2017 <<EMAIL>>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

const gulp = require('gulp')
const ts = require('gulp-typescript')
const uglify =require('gulp-uglify')
const nodeunit = require('gulp-nodeunit')

const browserify = require('browserify')
const tsify = require('tsify')

const source = require('vinyl-source-stream')
const buffer = require('vinyl-buffer')

const fs = require('fs')
const child_process = require('child_process')

// ----------------------------------------------------------------------------
// task
// ----------------------------------------------------------------------------

gulp.task('default', ['dist'])

gulp.task('dist', ['build', 'copy-testdata', 'copy-gyp-build', 'copy-cxx-emscripten', 'example'])

gulp.task('build', ['build-gyp'], () => {
	let tsProj = ts.createProject('tsconfig.json')
	return tsProj.src().pipe(tsProj()).pipe(gulp.dest('dist/lib'))
})

gulp.task('build-gyp', (cb) => {
	let s1 = 'build/Release/guetzli.node'
	let s2 = 'build/Debug/guetzli.node'
	if(fs.existsSync(s1) || fs.existsSync(s2)) {
		cb()
		return
	}
	child_process.exec('node-gyp rebuild', function(err) {
		if(err) return cb(err)
		cb()<commit_msg>avoid bad task on darwin<commit_after>// Copyright 2017 <<EMAIL>{AT}<EMAIL>>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

const gulp = require('gulp')
const ts = require('gulp-typescript')
const uglify =require('gulp-uglify')
const nodeunit = require('gulp-nodeunit')

const browserify = require('browserify')
const tsify = require('tsify')

const source = require('vinyl-source-stream')
const buffer = require('vinyl-buffer')

const fs = require('fs')
const child_process = require('child_process')

// ----------------------------------------------------------------------------
// task
// gulp dist
// gulp copy-cxx-emscripten
// gulp example
// ----------------------------------------------------------------------------

gulp.task('default', ['dist'])

gulp.task('dist', ['build', 'copy-testdata', 'copy-gyp-build'])

gulp.task('build', ['build-gyp'], () => {
	let tsProj = ts.createProject('tsconfig.json')
	return tsProj.src().pipe(tsProj()).pipe(gulp.dest('dist/lib'))
})

gulp.task('build-gyp', (cb) => {
	let s1 = 'build/Release/guetzli.node'
	let s2 = 'build/Debug/guetzli.node'
	if(fs.existsSync(s1) || fs.existsSync(s2)) {
		cb()
		return
	}
	child_process.exec('node-gyp rebuild', function(err) {
		if(err) return cb(err)
		cb()
{'fraction_non_alphanumeric': 0.2794625719769674, 'fraction_numerical': 0.006142034548944338, 'mean_word_length': 2.6807909604519775, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, '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': '4838142', 'n_tokens_mistral': 850, 'n_tokens_neox': 825, 'n_words': 189}