var _ = require("lodash");
var path = require("path");
var Bacon = require("baconjs");
var nodegit = require("nodegit");

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

var Application = require("../models/application.js");
var Git = require("../models/git.js")(path.resolve("."));

var unlink = module.exports = function(api, params) {
  var alias = params.args[0];

  var s_app = Application.unlinkRepo(api, alias);

  s_app.onValue(function(app) {
    Logger.println("Your application has been successfully unlinked!");
  });

  s_app.onError(Logger.error);
};

@@ -150,24 +150,83 @@
 gger.js%22);%0A%0A
+var AppConfig = require(%22../models/app_configuration.js%22);%0A
 var Applicat
@@ -427,55 +427,190 @@
 _app
+Data
  = App
-lication.unlinkRepo(api, alias);%0A%0A  s_app
+Config.getAppData(alias).toProperty();%0A%0A  var s_result = s_appData.flatMapLatest(function(appData) %7B%0A    return Application.unlinkRepo(api, appData.alias);%0A  %7D)%0A%0A  s_result
 .onV
@@ -713,19 +713,22 @@
 );%0A%0A  s_
-app
+result
 .onError

Make sure the application exists when unlinking