<commit_before>/* globals atom:false */

'use strict';

exports.provideBuilder = function () {
  return {
    niceName: 'Markdown',

    isEligable: function () {
      var textEditor = atom.workspace.getActiveTextEditor();
      if (!textEditor || !textEditor.getPath()) {
        return false;
      }
      var path = textEditor.getPath();
      return path.endsWith('.md') || path.endsWith('.mkd');
    },

    settings: function () {
      return [ {
        name: 'Markdown: view',
        sh: false,
        exec: 'open',
        args: [ '-a', 'Marked.app', '{FILE_ACTIVE}' ]
      }];
    }
  };
};<commit_msg>Use mdfind to find the name of Marked or Marked 2.<commit_after>/* globals atom:false */

'use strict';

var spawnSync = require('child_process').spawnSync;

exports.provideBuilder = function () {
  return {
    niceName: 'Markdown',

    isEligable: function () {
      var textEditor = atom.workspace.getActiveTextEditor();
      if (!textEditor || !textEditor.getPath()) {
        return false;
      }
      var path = textEditor.getPath();
      return path.endsWith('.md') || path.endsWith('.mkd');
    },

    settings: function () {

      var app = spawnSync('mdfind', ['kMDItemCFBundleIdentifier == "com.brettterpstra.mark*"']);
      app = app.stdout.toString().split('\n')[0];

      return [ {
        name: 'Markdown: view',
        sh: false,
        exec: 'open',
        args: [ '-a', app || 'Marked 2', '{FILE_ACTIVE}' ]
      }];
    }
  };
};
{'fraction_non_alphanumeric': 0.16959459459459458, 'fraction_numerical': 0.002027027027027027, 'mean_word_length': 2.509478672985782, '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': '2433319', 'n_tokens_mistral': 475, 'n_tokens_neox': 469, 'n_words': 102}