"use strict";
const os = require('os');
const UI = require('../../ui').UI;
const transform = require('../../colors/transform');
const createLines = require('../../string').createLines;

module.exports = class {
  static inject() { return [UI]; }

  constructor(ui) {
    this.ui = ui;
  }

  execute(context) {
    let project = context.state.project;

    return this.ui.question('Would you like to install the project dependencies?', [
      {
        displayName: 'Yes',
        description: 'Installs all server, client and tooling dependencies needed to build the project.',
        value: 'yes'
      },
      {
        displayName: 'No',
        description: 'Completes the new project wizard without installing dependencies.',
        value: 'no'
      }
    ]).then(answer => {
      if (answer.value === 'yes') {
        return this.ui.log(os.EOL + 'Installing project dependencies.')
          .then(() => project.install(this.ui))
          .then(() => this.displayCompletionMessage(project))
          .then(() => context.next(this.nextActivity));
      }

      return this.ui.log(os.EOL + 'Dependencies not installed.')
        .then(() => context.next());
    });
  }

  displayCompletionMessage(project) {
    let message = transform(`Now it's time for you to get started. It's easy. First, change directory into your new project's folder. You can use <magenta><bold>cd ${project.model.name}</bold></magenta> to get there. Once in your project folder, simply run your new app with <magenta><bold>au run</bold></magenta>. Your app will run fully bundled. If you would like to have it auto-refresh whenever you make changes to your HTML, JavaScript or CSS, simply use the <yellow>--watch</yellow> flag. If you want to build your app for production, run <magenta><bold>au build --env prod</bold></magenta>. That's just about all there is to it. If you need help, simply run <magenta><bold>au help</bold></magenta>.`);
    return this.ui.clearScreen()
      .then(() => this.ui.log(`Congratulations! Your Project "${project.model.name}" Has Been Created!` + os.EOL + os.EOL))
      .then(() => this.ui.log(createLines(message, '', this.ui.getWidth())))
      .then(() => this.ui.log(os.EOL + os.EOL + 'Happy Coding!'));
  }
}

@@ -177,16 +177,76 @@
 teLines;
+%0Aconst CLIOptions = require('../../cli-options').CLIOptions;
 %0A%0Amodule
@@ -294,16 +294,28 @@
 turn %5BUI
+, CLIOptions
 %5D; %7D%0A%0A  
@@ -328,16 +328,25 @@
 uctor(ui
+, options
 ) %7B%0A    
@@ -359,16 +359,44 @@
 i = ui;%0A
+    this.options = options;%0A
   %7D%0A%0A  e
@@ -1337,77 +1337,26 @@
 let 
-message = transform(%60Now it's time for you to get started. It's easy.
+notHereMessage = %60
  Fir
@@ -1588,16 +1588,269 @@
 agenta%3E.
+%60;%0A    let hereMessage = %60 Simply run your new app with %3Cmagenta%3E%3Cbold%3Eau run%3C/bold%3E%3C/magenta%3E.%60;%0A%0A    let message = transform(%60Now it's time for you to get started. It's easy.%60 +%0A    (this.options.hasFlag('here') ? hereMessage : notHereMessage) +%0A    %60
  Your ap
@@ -2236,16 +2236,17 @@
 ta%3E.%60);%0A
+%0A
     retu

change message based on here or not