<commit_before>/**
 * Step 1
 * Your initialization methods (checking current project state, getting configs, etc)
 */

var chalk = require('chalk'),
    updateNotifier = require('update-notifier'),
    printMessage = require('print-message'),
    yosay = require('yosay');

module.exports = {
    /**
     * Load package.json
     */
    loadPackageInfo: function () {
        this.pkg = require('../../../package.json');
    },

    /**
     * Say yeoman hello
     */
    sayHello: function () {
        if (!(this.options['skip-generator-welcome'] || this.options['skip-all'])) {
            this.log(yosay('Welcome to the laudable ' + chalk.red('Sails REST API') + ' generator!'));
        }
    },

    /**
     * Notify about updates of generator-sails-rest-api
     */
    notifyAboutGeneratorUpdate: function () {
        if (!(this.options['skip-generator-update'] || this.options['skip-all'])) {
            var done = this.async();

            this.log(chalk.yellow('Checking for updates...'));

            updateNotifier({
                pkg: this.pkg,
                callback: function (error, update) {
                    // TODO: print out error and process.exit()
                    // TODO: enable verbose mode if exists
                    if (update && update.type !== 'latest') {
                        printMessage([<commit_msg>Add console error on updates checking<commit_after>/**
 * Step 1
 * Your initialization methods (checking current project state, getting configs, etc)
 */

var chalk = require('chalk'),
    updateNotifier = require('update-notifier'),
    printMessage = require('print-message'),
    yosay = require('yosay');

module.exports = {
    /**
     * Load package.json
     */
    loadPackageInfo: function () {
        this.pkg = require('../../../package.json');
    },

    /**
     * Say yeoman hello
     */
    sayHello: function () {
        if (!(this.options['skip-generator-welcome'] || this.options['skip-all'])) {
            this.log(yosay('Welcome to the laudable ' + chalk.red('Sails REST API') + ' generator!'));
        }
    },

    /**
     * Notify about updates of generator-sails-rest-api
     */
    notifyAboutGeneratorUpdate: function () {
        if (!(this.options['skip-generator-update'] || this.options['skip-all'])) {
            var done = this.async();

            this.log(chalk.yellow('Checking for updates...'));

            updateNotifier({
                pkg: this.pkg,
                callback: function (error, update) {
                    if (error) {
                        console.error(error.stack || error);
                        return process.exit(1);
                    }

                    if (update && update.type !== 'latest') {
                        printMessage([
{'fraction_non_alphanumeric': 0.15179856115107915, 'fraction_numerical': 0.001079136690647482, 'mean_word_length': 1.8908523908523909, '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': '1064299', 'n_tokens_mistral': 770, 'n_tokens_neox': 727, 'n_words': 168}