<commit_before>'use strict';

var fs = require('fs');
var which = require('which');
var forEach = require('lodash/collection/forEach');
var packager = require('electron-packager');
var copyRecursive = require('ncp');
var archiver = require('archiver');

module.exports = function(grunt) {

  grunt.registerMultiTask('distro', function(target) {
    var packageJson = require('../package.json');
    var electronVersion = '0.34.3';

    var platform = this.data.platform;
    var done = this.async();

    var options = {
      name: packageJson.name,
      dir: __dirname + '/../',
      out: __dirname + '/../distro',
      version: electronVersion,
      platform: platform,
      arch: 'all',
      'app-version': packageJson.version,
      overwrite: true,
      asar: true,
      icon: __dirname + '/../resources/icons/icon_128',
      ignore: buildDistroIgnore()
    };

    function buildDistroIgnore() {

      var ignore = [
        'app/develop',
        'distro',
        'client',
        'resources',
        'app/test',
        '.babelrc',
        '.editorconfig',
        '.eslintrc',
        '.gitignore',
        '.travis.yml',
        '.wiredeps',
        'Gruntfile.js',
        'gulpfile.js',
        'README.md'
      ];

      forEach(packageJson.devDependencies, function(version, name) {
        ignore.push('node_modules/' + name);
      });

      return new RegExp('(' + ignore.join('|') + ')');
    }

    if (platform === 'darwin') {
      options.name = 'Camunda Modeler';
    }

    if (platform === 'win32') {
      options['version-string'] = {
        CompanyName: 'camunda Services GmbH',
        LegalCopyright: 'camunda Services GmbH, 2015',
        FileDescription: 'Camunda Modeler',
        OriginalFilename: 'camunda-modeler.exe',
        // inherited by electron
        // FileVersion: electronVersion,
        ProductVersion: packageJson.version,
        ProductName: 'Camunda Modeler',
        InternalName: 'camunda-modeler'
      };

      // make sure wine is available on linux systems
      // if we are building the windows distribution
      if (process.platform !== 'win32' && platform === 'win32') {
        try {
          which.sync('wine');
        } catch (e) {
          console.log('Skipping Windows packaging: wine is not found');
          return done();
        }
      }
    }<commit_msg>chore(build): make missing wine more apparent<commit_after>'use strict';

var fs = require('fs');
var which = require('which');
var forEach = require('lodash/collection/forEach');
var packager = require('electron-packager');
var copyRecursive = require('ncp');
var archiver = require('archiver');

module.exports = function(grunt) {

  grunt.registerMultiTask('distro', function(target) {
    var packageJson = require('../package.json');
    var electronVersion = '0.34.3';

    var platform = this.data.platform;
    var done = this.async();

    var options = {
      name: packageJson.name,
      dir: __dirname + '/../',
      out: __dirname + '/../distro',
      version: electronVersion,
      platform: platform,
      arch: 'all',
      'app-version': packageJson.version,
      overwrite: true,
      asar: true,
      icon: __dirname + '/../resources/icons/icon_128',
      ignore: buildDistroIgnore()
    };

    function buildDistroIgnore() {

      var ignore = [
        'app/develop',
        'distro',
        'client',
        'resources',
        'app/test',
        '.babelrc',
        '.editorconfig',
        '.eslintrc',
        '.gitignore',
        '.travis.yml',
        '.wiredeps',
        'Gruntfile.js',
        'gulpfile.js',
        'README.md'
      ];

      forEach(packageJson.devDependencies, function(version, name) {
        ignore.push('node_modules/' + name);
      });

      return new RegExp('(' + ignore.join('|') + ')');
    }

    if (platform === 'darwin') {
      options.name = 'Camunda Modeler';
    }

    if (platform === 'win32') {
      options['version-string'] = {
        CompanyName: 'camunda Services GmbH',
        LegalCopyright: 'camunda Services GmbH, 2015',
        FileDescription: 'Camunda Modeler',
        OriginalFilename: 'camunda-modeler.exe',
        // inherited by electron
        // FileVersion: electronVersion,
        ProductVersion: packageJson.version,
        ProductName: 'Camunda Modeler',
        InternalName: 'camunda-modeler'
      };

      // make sure wine is available on linux systems
      // if we are building the windows distribution
      if (process.platform !== 'win32' && platform === 'win32') {
        try {
          which.sync('wine');
        } catch (e) {
          grunt.log.writeln('Skipping Windows packaging: wine is not found'['red']);
          return done();
        }
      }
    }
{'fraction_non_alphanumeric': 0.147820593809223, 'fraction_numerical': 0.007159401979364077, 'mean_word_length': 2.2781228433402347, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2436229', 'n_tokens_mistral': 1423, 'n_tokens_neox': 1357, 'n_words': 321}