<commit_before>'use strict';

Object.defineProperty(exports, '__esModule', {
  value: true
});

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var _shelljs = require('shelljs');

var _shelljs2 = _interopRequireDefault(_shelljs);

var _minimist = require('minimist');

var _minimist2 = _interopRequireDefault(_minimist);

var _jsYaml = require('js-yaml');

var _jsYaml2 = _interopRequireDefault(_jsYaml);

var _fs = require('fs');

var _fs2 = _interopRequireDefault(_fs);

var _output = require('./output');

var _output2 = _interopRequireDefault(_output);

var _packageJson = require('./../../package.json');

var _packageJson2 = _interopRequireDefault(_packageJson);

var config = {
  /**
   * Object to contain runtime opts
   */
  manifest: {},
  /**
   * Current working directory
   */
  cwd: _shelljs2['default'].pwd(),
  /**
   * Get arguments
   */
  args: process.argv[0] === 'node' ? (0, _minimist2['default'])(process.argv.slice(1)) : (0, _minimist2['default'])(process.argv.slice(2)),
  /**
   * Help message template
   */
  helpMsg: '\n    ' + _packageJson2['default'].name + ' v.' + _packageJson2['default'].version + '\n\n    Usage: ' + _packageJson2['default'].name + ' task [options]\n\n      -h   Show this help message\n      -v   Show current version\n      -i   Run container with STDIN support\n      -e   Run custom command(s): -e "some command"\n      -f   Set FROM (Docker image): -f "container:tag"\n      -c   Set config to load (YAML): -c "/path/to/config.yml"\n',
  /**
   * Checks arguments for specific (immediate action) flags and config
   * @param {Object} args The arguments passed in
   */
  checkArgs: function checkArgs(args) {
    console.log(args);
    // Show help
    if (args.h) {
      _output2['default'].log(config.helpMsg);process.exit(0);
    }
    // Show version
    if (args.v) {
      _output2['default'].log(_packageJson2['default'].version);process.exit(0);
    }
    // Get interactive flag
    config.interactive = args.i ? true : false;
    // Set exec
    config.exec = args.e ? args.e : false;
    // Load yaml config
    config.manifestPath = args.c ? config.cwd + '/' + args.c : config.cwd + '/laminar.yml';
    // Override from
    config.from = args.f ? args.f : false;
    // Set task
    config.task = args._ ? args._.pop() : false;
  },
  /**
   * Loads manifest and sets basic props
   */
  loadManifest: function loadManifest() {
    try {
      config.manifest = _jsYaml2['default'].safeLoad(_fs2['default'].readFileSync(config.manifestPath, 'utf8'));<commit_msg>Push new build of config<commit_after>'use strict';

Object.defineProperty(exports, '__esModule', {
  value: true
});

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var _shelljs = require('shelljs');

var _shelljs2 = _interopRequireDefault(_shelljs);

var _minimist = require('minimist');

var _minimist2 = _interopRequireDefault(_minimist);

var _jsYaml = require('js-yaml');

var _jsYaml2 = _interopRequireDefault(_jsYaml);

var _fs = require('fs');

var _fs2 = _interopRequireDefault(_fs);

var _output = require('./output');

var _output2 = _interopRequireDefault(_output);

var _packageJson = require('./../../package.json');

var _packageJson2 = _interopRequireDefault(_packageJson);

var config = {
  /**
   * Object to contain runtime opts
   */
  manifest: {},
  /**
   * Current working directory
   */
  cwd: _shelljs2['default'].pwd(),
  /**
   * Get arguments
   */
  args: process.argv[0] === 'node' ? (0, _minimist2['default'])(process.argv.slice(1)) : (0, _minimist2['default'])(process.argv.slice(2)),
  /**
   * Help message template
   */
  helpMsg: '\n    ' + _packageJson2['default'].name + ' v.' + _packageJson2['default'].version + '\n\n    Usage: ' + _packageJson2['default'].name + ' task [options]\n\n      -h   Show this help message\n      -v   Show current version\n      -i   Run container with STDIN support\n      -e   Run custom command(s): -e "some command"\n      -f   Set FROM (Docker image): -f "container:tag"\n      -c   Set config to load (YAML): -c "/path/to/config.yml"\n',
  /**
   * Checks arguments for specific (immediate action) flags and config
   * @param {Object} args The arguments passed in
   */
  checkArgs: function checkArgs(args) {
    // Show help
    if (args.h) {
      _output2['default'].log(config.helpMsg);process.exit(0);
    }
    // Show version
    if (args.v) {
      _output2['default'].log(_packageJson2['default'].version);process.exit(0);
    }
    // Get interactive flag
    config.interactive = args.i ? true : false;
    // Set exec
    config.exec = args.e ? args.e : false;
    // Load yaml config
    config.manifestPath = args.c ? config.cwd + '/' + args.c : config.cwd + '/laminar.yml';
    // Override from
    config.from = args.f ? args.f : false;
    // Set task
    config.task = args._ ? args._.pop() : false;
  },
  /**
   * Loads manifest and sets basic props
   */
  loadManifest: function loadManifest() {
    try {
      config.manifest = _jsYaml2['default'].safeLoad(_fs2['default'].readFileSync(config.manifestPath, 'utf8'));
{'fraction_non_alphanumeric': 0.1593640946103141, 'fraction_numerical': 0.009693679720822024, 'mean_word_length': 3.190901705930138, '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': '4582626', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1698, 'n_words': 400}