'use strict';
var shell = require('shelljs');
var PATHNAME = 'Minion';
var colors = require('colors');
var Gru = function (){};

Gru.prototype.init = function (appName, appType) {
	var ionicStart = 'ionic start ' + PATHNAME + ' ' + appType;
	var ionicSetupSass = 'ionic setup sass';

	function checkMethod(method) {
		if (!shell.which(method)) {
			shell.echo('Sorry, this script requires ' + method);
			shell.exit(1);
		}
	}

	checkMethod('git');
	checkMethod('ionic');

	shell.exec(ionicStart);
	shell.cd(PATHNAME);
	shell.exec(ionicSetupSass);
	shell.cd('../');
	shell.exec('touch .minion');
};

Gru.prototype.run = function() {
	shell.cd(PATHNAME);
	var ionicRunServer = 'ionic serve';
	shell.exec(ionicRunServer);
	return true;
};

Gru.prototype.create = function (appName, appType) {
	if(!shell.test('-e', '.minion')) {
		this.init(appName, appType);
	} else {
		console.log(colors.red.underline('file already exist'));
	}
	return true;
};

module.exports = Gru;

@@ -626,37 +626,16 @@
 ion() %7B%0A
-%09shell.cd(PATHNAME);%0A
 %09var ion
@@ -662,16 +662,38 @@
  serve';
+%0A%0A%09shell.cd(PATHNAME);
 %0A%09shell.
@@ -714,30 +714,16 @@
 erver);%0A
-%09return true;%0A
 %7D;%0A%0AGru.

remove unneeds logic