<commit_before>var _ = require("lodash");
var path = require("path");
var Bacon = require("baconjs");

var Logger = require("../logger.js");

var AppConfig = require("../models/app_configuration.js");
var Application = require("../models/application.js");

var app_delete = module.exports = function(api, params) {
  var alias = params.options.alias;
  var skipConfirmation = params.options.yes;

  var s_appData = AppConfig.getAppData(alias).toProperty();

  var s_delete = s_appData.flatMapLatest(function(app_data) {
    return Application.adelete(api, app_data, skipConfirmation);
  });

  s_delete.onValue(function() {
    Logger.println("The application has been deleted")
  });
  s_delete.onError(Logger.error);
};

<commit_msg>Unlink application after deleting it.<commit_after>var _ = require("lodash");
var path = require("path");
var Bacon = require("baconjs");

var Logger = require("../logger.js");

var AppConfig = require("../models/app_configuration.js");
var Application = require("../models/application.js");

var app_delete = module.exports = function(api, params) {
  var alias = params.options.alias;
  var skipConfirmation = params.options.yes;

  var s_appData = AppConfig.getAppData(alias).toProperty();

  var s_delete = s_appData.flatMapLatest((app_data) => {
    return Application.adelete(api, app_data, skipConfirmation)
      .flatMapLatest(() => Application.unlinkRepo(api, app_data.alias))
  });

  s_delete.onValue(function() {
    Logger.println("The application has been deleted")
  });
  s_delete.onError(Logger.error);
};


{'fraction_non_alphanumeric': 0.15128205128205127, 'fraction_numerical': 0.0, 'mean_word_length': 4.912878787878788, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2449657', 'n_tokens_mistral': 493, 'n_tokens_neox': 481, 'n_words': 97}