<commit_before>'use strict';

const electron        = require('electron'),
    windowStateKeeper = require('electron-window-state'),
    path              = require('path'),
    openUrl           = require('open');

const {app, BrowserWindow, Menu, Tray, protocol} = electron;

let argv = require('minimist')(process.argv.slice(1)),
    win  = null,
    appHelper;

// Show command line help
if (argv.help || argv.h) {
    console.log('Usage: laverna [options]\r\n');
    console.log('--help', 'Show this help');
    console.log('--dev ', 'Show developer tools automatically on start');
    console.log('--tray', 'Hide to tray on start');
    console.log(
        '--data-dir',
        'Directory where data is stored.',
        'Example: laverna --data-dir=../data'
    );

    return app.quit();
}

// Allow to change the directory where the data is stored
if (argv['data-dir'] && argv['data-dir'].trim()) {
    let dataDir = argv['data-dir'].trim();

    // The same or parent directory
    if (dataDir.search(/^\./) > - 1) {

        // Always store data in a separate directory
        dataDir += (dataDir.search(/^\.{1,2}$/) > -1 ? '/laverna-data' : '');

        dataDir = path.join(__dirname, dataDir);
    }

    app.setPath('userData', path.normalize(dataDir));
}

appHelper = {

    // The page which will be loaded in the window
    page: 'http://localhost:9000/',

    // Icon of the app
    icon: path.join(__dirname, '/dist/images/icon/IconMenubarTemplate.png'),

    // The main menu
    menu: [
        {
            label   : '&File',
            submenu : [
                {
                    label       : 'Quit',
                    accelerator : 'CmdOrCtrl+Q',
                    click       : function() {
                        app.quit();
                    }
                }
            ]
        },
        {
            label: '&Edit',
            submenu: [
                {
                    label       : 'Undo',
                    accelerator : 'CmdOrCtrl+Z',
                    role        : 'undo'
                },
                {
                    label       : 'Redo',
                    accelerator : 'Shift+CmdOrCtrl+Z',
                    role        : 'redo'
                },
                {type: 'separator'},
                {<commit_msg>keep specialty icon conditional to darwin<commit_after>'use strict';

const electron        = require('electron'),
    windowStateKeeper = require('electron-window-state'),
    path              = require('path'),
    openUrl           = require('open');

const {app, BrowserWindow, Menu, Tray, protocol} = electron;

let argv = require('minimist')(process.argv.slice(1)),
    win  = null,
    appHelper;

// Show command line help
if (argv.help || argv.h) {
    console.log('Usage: laverna [options]\r\n');
    console.log('--help', 'Show this help');
    console.log('--dev ', 'Show developer tools automatically on start');
    console.log('--tray', 'Hide to tray on start');
    console.log(
        '--data-dir',
        'Directory where data is stored.',
        'Example: laverna --data-dir=../data'
    );

    return app.quit();
}

// Allow to change the directory where the data is stored
if (argv['data-dir'] && argv['data-dir'].trim()) {
    let dataDir = argv['data-dir'].trim();

    // The same or parent directory
    if (dataDir.search(/^\./) > - 1) {

        // Always store data in a separate directory
        dataDir += (dataDir.search(/^\.{1,2}$/) > -1 ? '/laverna-data' : '');

        dataDir = path.join(__dirname, dataDir);
    }

    app.setPath('userData', path.normalize(dataDir));
}

appHelper = {

    // The page which will be loaded in the window
    page: 'http://localhost:9000/',

    // Icon of the app
    icon: path.join(__dirname, '/dist/images/icon/',
      process.platform === 'darwin' ? 'IconMenubarTemplate.png' : 'icon-120x120.png'
    ),

    // The main menu
    menu: [
        {
            label   : '&File',
            submenu : [
                {
                    label       : 'Quit',
                    accelerator : 'CmdOrCtrl+Q',
                    click       : function() {
                        app.quit();
                    }
                }
            ]
        },
        {
            label: '&Edit',
            submenu: [
                {
                    label       : 'Undo',
                    accelerator : 'CmdOrCtrl+Z',
                    role        : 'undo'
                },
                {
                    label       : 'Redo',
                    accelerator : 'Shift+CmdOrCtrl+Z',
                    role        : 'redo'
                },
                {type: 'separator'},
                {
{'fraction_non_alphanumeric': 0.14683382915427115, 'fraction_numerical': 0.005099872503187421, 'mean_word_length': 1.4401244167962675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6381407', 'n_tokens_mistral': 1385, 'n_tokens_neox': 1310, 'n_words': 315}