message: bug: Fix issue that when "jovo new" got canceled because folder already existed it did go on anyway
diff: @@ -110,9 +110,10 @@ module.exports = (vorpal: Vorpal) => {
  const frameworkVersion = args.options.v1 ? 1 : 2;
  DEBUG = args.options.debug ? true : false;
  + let answers;
  +
  await project.init(frameworkVersion);
  - let p: Promise<void | JovoTaskContext> = Promise.resolve();
  // @ts-ignore
  const tasks = new Listr([], {
  renderer: JovoCliRenderer,
  @@ -125,39 +126,31 @@ module.exports = (vorpal: Vorpal) => {
  if (!args.directory) {
  - p = p.then(() => {
  - return promptNewProject().then((answers) => {
  + answers = await promptNewProject();
  args.directory = answers.directory;
  if (!isValidProjectName(args.directory)) {
  - // Stop code execution
  - p = Promise.resolve();
  - } else {
  - return Promise.resolve();
  + console.log(`The folder name "${args.directory}" is not valid`);
  + return;
  }
  - });
  - });
  }
  // asks for approval when project folder exists
  if (args.directory && project.hasExistingProject(args.directory)) {
  - p = p.then(() => {
  - return promptOverwriteProject().then((answers) => {
  + answers = await promptOverwriteProject();
  +
  if (answers.overwrite === ANSWER_CANCEL) {
  // exit on cancel
  - p = Promise.resolve();
  + return;
  } else {
  Utils.deleteFolderRecursive(path.join(process.cwd(), args.directory));
  - return Promise.resolve();
  }
  - });
  - });
  }
  if (args.options.init) {
  if (project.frameworkVersion !== 1) {
  console.error('The "init" option got deprecated and is only available for Jovo Framework v1 projects.');
  - return Promise.resolve();
  + return;
  }
  }
  @@ -176,29 +169,23 @@ module.exports = (vorpal: Vorpal) => {
  // If not platform is given but needed get it from user
  if (platformIsNeeded === true && config.types.length === 0) {
  - p = p.then(() => {
  - return promptForPlatform().then((answers) => {
  + answers = await promptForPlatform();
  config.types = [answers.platform];
  console.log();
  console.log();
  - });
  - });
  }
  if (args.options.deploy) {
  - p = p.then(() => {
  if (!args.options.build) {
  console.log('Please use --build if you use --deploy');
  - p = Promise.resolve();
  + return;
  }
  if (!args.options.init) {
  console.log('Please use --init <platform> if you use --build');
  - p = Promise.resolve();
  + return;
  }
  - });
  }
  - p = p.then(() => {
  console.log(' I\'m setting everything up');
  console.log();
  _.merge(config, {
  @@ -280,10 +267,7 @@ module.exports = (vorpal: Vorpal) => {
  enabled: () => !args.options['skip-npminstall'],
  task: () => project.runNpmInstall(),
  });
  - return Promise.resolve(config);
  - });
  - return p.then((config) => {
  return tasks.run(config).then(() => {
  console.log();
  console.log(' Installation completed.');
  @@ -294,5 +278,4 @@ module.exports = (vorpal: Vorpal) => {
  }
  });
  });
  - });
  };
  