<commit_before>var _ = require('lodash');
var async = require('async');
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;
var green = '\u001b[42m \u001b[0m';
var red = '\u001b[41m \u001b[0m';

module.exports = {
	name:'morning',
	description:'Runs clone, pull and then install to get your environment ready for action for the day',
	example:'bosco morning',
	cmd:cmd
}

function cmd(bosco, args) {

	var clone = require('./clone');
	var pull = require('./pull');
	var install = require('./install');

	clone.cmd(bosco, args, function() {
		pull.cmd(bosco, args, function() {
			install.cmd(bosco, args);
		});
	});
}
<commit_msg>Morning command now outputs a list of the commits that were added since you last ran the morning command. This is very useful to read who did what while you enjoy your morning coffee. We also record the last time you ran morning now and only show you the commits from that last time.<commit_after>var _ = require('lodash');
var async = require('async');
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;
var moment = require('moment');
var green = '\u001b[42m \u001b[0m';
var red = '\u001b[41m \u001b[0m';

module.exports = {
	name:'morning',
	description:'Runs clone, pull, installs and provides a summary of changes since your last morning command to get you ready for action for the day',
	example:'bosco morning',
	cmd:cmd
}

function cmd(bosco, args) {

	var clone = require('./clone');
	var pull = require('./pull');
	var install = require('./install');
	var activity = require('./activity');

	var lastMorningRunConfigKey = 'events:last-morning-run';

	var executeClone = function(next) {
		clone.cmd(bosco, args, next);
	};

	var executePull = function(next) {
		pull.cmd(bosco, args, next);
	};

	var executeInstall = function(next) {
		install.cmd(bosco, args, next);
	};

	var showActivitySummary = function(next) {
		args.since = bosco.config.get(lastMorningRunConfigKey); // If it is not set it will default to some value on the activity command

		activity.cmd(bosco, args, next);
	};

	var setConfigKeyForLastMorningRun = function(next) {
		bosco.config.set(lastMorningRunConfigKey, moment().format());
		bosco.config.save(next);
	};

	async.series([executeClone, executePull, executeInstall, showActivitySummary, setConfigKeyForLastMorningRun], function(err){
		bosco.log('Morning completed');
	});
}

{'fraction_non_alphanumeric': 0.14133114215283485, 'fraction_numerical': 0.014790468364831553, 'mean_word_length': 4.81145584725537, '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': '5282098', 'n_tokens_mistral': 827, 'n_tokens_neox': 755, 'n_words': 243}