<commit_before>/*eslint-env node*/
/*global global*/
/*eslint no-console:0*/

var $               = require('gulp-load-plugins')();
var gulp            = require('gulp');
var argv            = require('yargs').argv;
var sequence        = require('run-sequence');
var child_process   = require('child_process');

var nodeversion     = 'v5.2.0';

var fileLocations = {
  bower: ['bower_components/*/**'],
  node_modules: ['node_modules/*/**'],
  client: [
    'client/**/**',
    '!**/.DS_Store',
    '!.DS_Store'
  ],
  docs: ['docs/**/*'],
  gulp: ['gulp/**/*', '!gulp/package.js'],
  tests: ['tests/**/*'],
  main_components: [
    '.bowerrc',
    '.eslintrc',
    '.gitignore',
    '.sass-lint.yml',
    'bower.json',
    'FUSION_CONFIG.sample.js',
    'gulpfile.js',
    'karma.conf.js',
    'package.json',
    '*.sh',
    '*.md'
  ]
};

var shellCommands = [
  'mkdir -p tmp/node',
  'mkdir -p tmp/node/'+packageName(getOsTarget()),
  'mkdir -p tmp/lucidworks-view/lib/nodejs',
  'curl -o tmp/node/'+packageName(getOsTarget())+'.'+getOsTarget().extension+' '+buildUrl(getOsTarget()),
  'tar -xzf tmp/node/'+packageName(getOsTarget())+'.'+getOsTarget().extension+' -C tmp/lucidworks-view/lib/nodejs',
  'mv tmp/lucidworks-view/lib/nodejs/'+packageName(getOsTarget())+' tmp/lucidworks-view/lib/nodejs/node',
  'mkdir -p packages',
  'mkdir -p packages/'+getVersion(),
  'chmod +x tmp/lucidworks-view/lib/nodejs/node/bin/npm',
  'chmod +x tmp/lucidworks-view/lib/nodejs/node/bin/node',
  'chmod +x tmp/lucidworks-view/lib/nodejs/node/lib/node_modules/npm/bin/npm',
  'ls -al tmp/lucidworks-view',
  'cd tmp/; tar -cf ../packages/'+getVersion()+'/lucidworks-view-'+getOsTarget().os+'-'+getOsTarget().platform+'-'+getVersion()+'.tar lucidworks-view/.'
];

// Copies the entire built-app for deployment but doesn't tarball
gulp.task('cook', function(cb) {
  sequence('clean:package', 'clean:tar', 'move:app', cb);
});

//Tarballs
gulp.task('package', function(cb){
  if(!argv.buildTarget && !(argv.buildname && argv.os && argv.platform && argv.extension)){
    console.log('\nTo use package you need to use a valid buildTarget parameter.\n  Ex: gulp package --buildTarget=mac\n  Possible build targets: {mac, linux, linux32, sunos, sunos32}\n\nOR all of these parameters:\nbuildname, buildTarget, os, platform, extension\n  Ex: gulp build --buildname=mac --os=darwin --platform=x64 --extension=tar.gz\n');
    cb();
  } else {
    sequence('package:bashCommands', cb);
  }
});

gulp.task('move:app', ['move:bower', 'move:node_modules', 'move:client', 'move:docs', 'move:gulp', 'move:tests'], function(cb){
  gulp.src(fileLocations.main_components)
  .pipe(gulp.dest('tmp/lucidworks-view'));
  cb();
});
gulp.task('move:bower', function(cb){
  // gulp.src(fileLocations.bower, {dot: true})
  // .pipe(gulp.dest('tmp/lucidworks-view/bower_components'));
  child_process.execSync('mkdir -p tmp/lucidworks-view/bower_components; cp -r bower_components/ tmp/lucidworks-view/bower_components/');
  cb();
});
gulp.task('move:node_modules', function(cb){
  // gulp.src(fileLocations.node_modules)
  // .pipe(gulp.dest('tmp/lucidworks-view/node_modules'));
  child_process.execSync('mkdir -p tmp/lucidworks-view/node_modules; cp -r node_modules/ tmp/lucidworks-view/node_modules/');
  cb();
});
gulp.task('move:client', function(cb){
  gulp.src(fileLocations.client, {dot: true})
  .pipe(gulp.dest('tmp/lucidworks-view/client'));
  cb();
});
gulp.task('move:docs', function(cb){
  gulp.src(fileLocations.docs)
  .pipe(gulp.dest('tmp/lucidworks-view/docs'));
  cb();
});
gulp.task('move:gulp', function(cb){
  gulp.src(fileLocations.gulp)
  .pipe(gulp.dest('tmp/lucidworks-view/gulp'));
  cb();
});
gulp.task('move:tests', function(cb){
  gulp.src(fileLocations.tests, {dot: true})
  .pipe(gulp.dest('tmp/lucidworks-view/tests'));
  cb();
});

gulp.task('package:bashCommands', function(cb){
  console.log(cb);
  for(var index = 0; index < shellCommands.length; index++){
    var command = shellCommands[index];
    console.log(child_process.execSync(command).toString('utf8'));
  }
});

////////

function getVersion(){
  var fs = require('fs');
  var packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
  return packageJson.version;
}

<commit_msg>Fixed more package thingies<commit_after>/*eslint-env node*/
/*global global*/
/*eslint no-console:0*/

var $               = require('gulp-load-plugins')();
var gulp            = require('gulp');
var argv            = require('yargs').argv;
var sequence        = require('run-sequence');
var child_process   = require('child_process');

var nodeversion     = 'v5.2.0';

var fileLocations = {
  bower: ['bower_components/*/**'],
  node_modules: ['node_modules/*/**'],
  client: [
    'client/**/**',
    '!**/.DS_Store',
    '!.DS_Store'
  ],
  docs: ['docs/**/*'],
  gulp: ['gulp/**/*', '!gulp/package.js'],
  tests: ['tests/**/*'],
  main_components: [
    '.bowerrc',
    '.eslintrc',
    '.gitignore',
    '.sass-lint.yml',
    'bower.json',
    'FUSION_CONFIG.sample.js',
    'gulpfile.js',
    'karma.conf.js',
    'package.json',
    '*.sh',
    '*.md'
  ]
};

var shellCommands = [
  'mkdir -p tmp/node',
  'mkdir -p tmp/node/'+packageName(getOsTarget()),
  'mkdir -p tmp/lucidworks-view/lib/nodejs',
  'curl -o tmp/node/'+packageName(getOsTarget())+'.'+getOsTarget().extension+' '+buildUrl(getOsTarget()),
  'tar -xzf tmp/node/'+packageName(getOsTarget())+'.'+getOsTarget().extension+' -C tmp/lucidworks-view/lib/nodejs',
  'mv tmp/lucidworks-view/lib/nodejs/'+packageName(getOsTarget())+' tmp/lucidworks-view/lib/nodejs/node',
  'mkdir -p packages',
  'mkdir -p packages/'+getVersion(),
  'chmod +x tmp/lucidworks-view/lib/nodejs/node/bin/npm',
  'chmod +x tmp/lucidworks-view/lib/nodejs/node/bin/node',
  'chmod +x tmp/lucidworks-view/lib/nodejs/node/lib/node_modules/npm/bin/npm',
  'ls -al tmp/lucidworks-view',
  'cd tmp/; tar -cf ../packages/'+getVersion()+'/lucidworks-view-'+getOsTarget().os+'-'+getOsTarget().platform+'-'+getVersion()+'.tar lucidworks-view/.'
];

// Copies the entire built-app for deployment but doesn't tarball
gulp.task('cook', function(cb) {
  sequence('clean:package', 'clean:tar', 'move:app', cb);
});

//Tarballs
gulp.task('package', function(cb){
  if(!argv.buildTarget && !(argv.buildname && argv.os && argv.platform && argv.extension)){
    console.log('\nTo use package you need to use a valid buildTarget parameter.\n  Ex: gulp package --buildTarget=mac\n  Possible build targets: {mac, linux, linux32, sunos, sunos32}\n\nOR all of these parameters:\nbuildname, buildTarget, os, platform, extension\n  Ex: gulp build --buildname=mac --os=darwin --platform=x64 --extension=tar.gz\n');
    cb();
  } else {
    sequence('package:bashCommands', cb);
  }
});

gulp.task('move:app', ['move:bower', 'move:node_modules', 'move:client', 'move:docs', 'move:gulp', 'move:tests'], function(cb){
  gulp.src(fileLocations.main_components)
  .pipe(gulp.dest('tmp/lucidworks-view'));
  cb();
});
gulp.task('move:bower', function(cb){
  // gulp.src(fileLocations.bower, {dot: true})
  // .pipe(gulp.dest('tmp/lucidworks-view/bower_components'));
  child_process.execSync('mkdir -p tmp/lucidworks-view/bower_components; cp -r bower_components tmp/lucidworks-view/');
  cb();
});
gulp.task('move:node_modules', function(cb){
  // gulp.src(fileLocations.node_modules)
  // .pipe(gulp.dest('tmp/lucidworks-view/node_modules'));
  child_process.execSync('mkdir -p tmp/lucidworks-view/node_modules; cp -r node_modules tmp/lucidworks-view/');
  cb();
});
gulp.task('move:client', function(cb){
  gulp.src(fileLocations.client, {dot: true})
  .pipe(gulp.dest('tmp/lucidworks-view/client'));
  cb();
});
gulp.task('move:docs', function(cb){
  gulp.src(fileLocations.docs)
  .pipe(gulp.dest('tmp/lucidworks-view/docs'));
  cb();
});
gulp.task('move:gulp', function(cb){
  gulp.src(fileLocations.gulp)
  .pipe(gulp.dest('tmp/lucidworks-view/gulp'));
  cb();
});
gulp.task('move:tests', function(cb){
  gulp.src(fileLocations.tests, {dot: true})
  .pipe(gulp.dest('tmp/lucidworks-view/tests'));
  cb();
});

gulp.task('package:bashCommands', function(cb){
  for(var index = 0; index < shellCommands.length; index++){
    var command = shellCommands[index];
    console.log(command);
    console.log(child_process.execSync(command).toString('utf8'));
  }
  cb();
});

////////

function getVersion(){
  var fs = require('fs');
  var packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
  return packageJson.version;
}


{'fraction_non_alphanumeric': 0.21105232216343328, 'fraction_numerical': 0.0030570252792475015, 'mean_word_length': 4.234461538461538, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2796832', 'n_tokens_mistral': 3208, 'n_tokens_neox': 3140, 'n_words': 502}