<commit_before>'use strict';
var fs = require('fs');
var util = require('util');
var path = require('path');
var yeoman = require('yeoman-generator');
var wiredep = require('wiredep');
var chalk = require('chalk');


var MeanGenerator = yeoman.generators.Base.extend({
	constructor: function(args, options) {
		yeoman.generators.Base.apply(this, arguments);

		
		this.pkg = require('../package.json');

		this.argument('appname', { type: String, required: false });
		this.argument('no-hooks', { type: Boolean, required: false });
		this.appname = this.appname || path.basename(process.cwd());
		this.appname = this._.camelize(this._.slugify(this._.humanize(this.appname)));

		if (typeof this.env.options.appPath === 'undefined') {
			try {
				this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
			} catch (e) {}
			if(!this.env.options.appPath) {
				this.env.options.appPath = this.options.appPath || 'public';
			}
		}

		this.config.set('appPath', this.env.options.appPath);
		this.appPath = this.env.options.appPath;



		args = ['main'];
		
		if(!this.arguments['no-hooks']) {
			this.hookFor('mean:boilerplate', {
				args: args,
				options: {
					options: {
						'appPath': 'public'
					}
				}
			});

			this.hookFor('angular:main', {
				args: args,
				options: {
					options: {
						'appPath': 'public'
					}
				}
			});

			this.hookFor('angular:controller', {
				args: args,
				options: {
					options: {
						'appPath': 'public'
					}
				}
			});
			
			this.hookFor('mean:server', {
				args: args,
				options: {
					options: {
						'appPath': 'public'
					}
				}
			});
		}

		this.on('end', function() {
			if (!this.options['skip-install']) {
				this.installDependencies({
					callback: function() {
						this._injectDependencies.bind(this);

						if(!this.options['no-git']) {
							this.spawnCommand('grunt', ['init']);

						}
					}
				});
			}

			this.invoke('karma:app', {
				options: {
					cwd: this.destinationRoot(),
					coffee: this.options.coffee,
					travis: false,
					'skip-install': this.options['skip-install'],
					components: [
						'angular/angular.js',
						'angular-mocks/angular-mocks.js',
						'angular-resource/angular-resource.js',
						'angular-cookies/angular-cookies.js',
						'angular-sanitize/angular-sanitize.js',
						'angular-route/angular-route.js'
					]
				}
			});
		});
	},

	welcome: function() {
		// have Yeoman greet the user
		this.log(this.yeoman);
<commit_msg>change order of final tasks<commit_after>'use strict';
var fs = require('fs');
var util = require('util');
var path = require('path');
var yeoman = require('yeoman-generator');
var wiredep = require('wiredep');
var chalk = require('chalk');


var MeanGenerator = yeoman.generators.Base.extend({
	constructor: function(args, options) {
		yeoman.generators.Base.apply(this, arguments);


		this.pkg = require('../package.json');

		this.argument('appname', { type: String, required: false });
		this.argument('no-hooks', { type: Boolean, required: false });
		this.appname = this.appname || path.basename(process.cwd());
		this.appname = this._.camelize(this._.slugify(this._.humanize(this.appname)));

		if (typeof this.env.options.appPath === 'undefined') {
			try {
				this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
			} catch (e) {}
			if(!this.env.options.appPath) {
				this.env.options.appPath = this.options.appPath || 'public';
			}
		}

		this.config.set('appPath', this.env.options.appPath);
		this.appPath = this.env.options.appPath;



		args = ['main'];
		
		if(!this.arguments['no-hooks']) {
			this.hookFor('mean:boilerplate', {
				args: args,
				options: {
					options: {
						'appPath': 'public'
					}
				}
			});

			this.hookFor('angular:main', {
				args: args,
				options: {
					options: {
						'appPath': 'public'
					}
				}
			});

			this.hookFor('angular:controller', {
				args: args,
				options: {
					options: {
						'appPath': 'public'
					}
				}
			});
			
			this.hookFor('mean:server', {
				args: args,
				options: {
					options: {
						'appPath': 'public'
					}
				}
			});
		}

		this.on('end', function() {
			this.invoke('karma:app', {
				options: {
					cwd: this.destinationRoot(),
					coffee: this.options.coffee,
					travis: false,
					'skip-install': this.options['skip-install'],
					components: [
						'angular/angular.js',
						'angular-mocks/angular-mocks.js',
						'angular-resource/angular-resource.js',
						'angular-cookies/angular-cookies.js',
						'angular-sanitize/angular-sanitize.js',
						'angular-route/angular-route.js'
					]
				}
			});

			if (!this.options['skip-install']) {
				this.installDependencies({
					callback: function() {
						this._injectDependencies.bind(this);

						if(!this.options['no-git']) {
							this.spawnCommand('grunt', ['init']);

						}
					}.bind(this)
				});
			}
		});
	},

	welcome: function() {
		// have Yeoman greet the user
		this.log(this.yeoman);

{'fraction_non_alphanumeric': 0.18216205454907425, 'fraction_numerical': 0.0, 'mean_word_length': 2.835114503816794, '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': '3542633', 'n_tokens_mistral': 2221, 'n_tokens_neox': 1708, 'n_words': 265}