<commit_before>'use babel';

import { BufferedProcess } from 'atom';
import { merge } from 'lodash';
import queue from './queue';
import output from './output';

export default async function(projectFolder, command, args, options) {
  const task = () => {
    const bin = atom.config.get('atom-yarn.bin');
    const env = merge({}, process.env, { NODE_ENV: 'development' });

    if (options && options.onStart) {
      options.onStart();
    }

    // TODO: Provide config to stop this always showing
    output.show();
    output.start();

    return new Promise(resolve => {
      new BufferedProcess({
        command: bin,
        args: args ? [command, ...args] : [command],
        stdout: output.write,
        stderr: output.write,
        exit: code => {
          resolve(code === 0);
        },
        options: {
          cwd: projectFolder,
          env
        }
      });
    });
  };

  return await queue.execute(task);
}
<commit_msg>Output the shell commands that get executed when calling Yarn<commit_after>'use babel';

import { BufferedProcess } from 'atom';
import { merge } from 'lodash';
import queue from './queue';
import output from './output';

export default async function(projectFolder, command, args, options) {
  const task = () => {
    const bin = atom.config.get('atom-yarn.bin');
    const env = merge({}, process.env, {
      NODE_ENV: 'development'
    });

    if (options && options.onStart) {
      options.onStart();
    }

    // TODO: Provide config to stop this always showing
    output.show();
    output.start();

    const combinedArgs = args ? [command, ...args] : [command];

    output.write(`$ ${bin} ${combinedArgs.join(' ')}`);

    return new Promise(resolve => {
      new BufferedProcess({
        command: bin,
        args: combinedArgs,
        stdout: output.write,
        stderr: output.write,
        exit: code => {
          resolve(code === 0);
        },
        options: {
          cwd: projectFolder,
          env
        }
      });
    });
  };

  return await queue.execute(task);
}

{'fraction_non_alphanumeric': 0.1454192922927775, 'fraction_numerical': 0.0009694619486185168, 'mean_word_length': 2.3398058252427183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4578089', 'n_tokens_mistral': 610, 'n_tokens_neox': 589, 'n_words': 169}