From f921488e8cf058ba87ea32ac8ad310dd94118741 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 21 Oct 2015 13:25:22 -0400 Subject: [PATCH] Remove app associate command --- build/actions/app.js | 39 +-------------------------------------- build/app.js | 2 -- lib/actions/app.coffee | 42 ------------------------------------------ lib/app.coffee | 1 - 4 files changed, 1 insertion(+), 83 deletions(-) diff --git a/build/actions/app.js b/build/actions/app.js index 73a52574..574a46ed 100644 --- a/build/actions/app.js +++ b/build/actions/app.js @@ -1,7 +1,5 @@ (function() { - var _, commandOptions, events, helpers, patterns, resin, vcs, visuals; - - _ = require('lodash'); + var commandOptions, events, patterns, resin, visuals; resin = require('resin-sdk'); @@ -9,12 +7,8 @@ commandOptions = require('./command-options'); - vcs = require('resin-vcs'); - events = require('resin-cli-events'); - helpers = require('../utils/helpers'); - patterns = require('../utils/patterns'); exports.create = { @@ -107,35 +101,4 @@ } }; - exports.associate = { - signature: 'app associate ', - description: 'associate a resin project', - help: 'Use this command to associate a project directory with a resin application.\n\nThis command adds a \'resin\' git remote to the directory and runs git init if necessary.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n\n $ resin app associate MyApp', - options: [commandOptions.yes], - permission: 'user', - action: function(params, options, done) { - var currentDirectory; - currentDirectory = process.cwd(); - console.info("Associating " + params.name + " with " + currentDirectory); - return resin.models.application.has(params.name).then(function(hasApplication) { - if (!hasApplication) { - throw new Error("Invalid application: " + params.name); - } - }).then(function() { - var message; - message = "Are you sure you want to associate " + currentDirectory + " with " + params.name + "?"; - return patterns.confirm(options.yes, message); - }).then(function() { - return resin.models.application.get(params.name).get('git_repository').then(function(gitRepository) { - return vcs.initialize(currentDirectory).then(function() { - return vcs.associate(currentDirectory, gitRepository); - }).then(function() { - console.info("git repository added: " + gitRepository); - return gitRepository; - }); - }); - }).nodeify(done); - } - }; - }).call(this); diff --git a/build/app.js b/build/app.js index 2abe96db..719e291f 100644 --- a/build/app.js +++ b/build/app.js @@ -56,8 +56,6 @@ capitano.command(actions.app.restart); - capitano.command(actions.app.associate); - capitano.command(actions.app.info); capitano.command(actions.device.list); diff --git a/lib/actions/app.coffee b/lib/actions/app.coffee index e4033017..43f036b4 100644 --- a/lib/actions/app.coffee +++ b/lib/actions/app.coffee @@ -1,10 +1,7 @@ -_ = require('lodash') resin = require('resin-sdk') visuals = require('resin-cli-visuals') commandOptions = require('./command-options') -vcs = require('resin-vcs') events = require('resin-cli-events') -helpers = require('../utils/helpers') patterns = require('../utils/patterns') exports.create = @@ -140,42 +137,3 @@ exports.remove = resin.models.application.get(params.name).then (application) -> events.send('application.delete', application: application.id) .nodeify(done) - -exports.associate = - signature: 'app associate ' - description: 'associate a resin project' - help: ''' - Use this command to associate a project directory with a resin application. - - This command adds a 'resin' git remote to the directory and runs git init if necessary. - - Notice this command asks for confirmation interactively. - You can avoid this by passing the `--yes` boolean option. - - Examples: - - $ resin app associate MyApp - ''' - options: [ commandOptions.yes ] - permission: 'user' - action: (params, options, done) -> - currentDirectory = process.cwd() - console.info("Associating #{params.name} with #{currentDirectory}") - - resin.models.application.has(params.name).then (hasApplication) -> - if not hasApplication - throw new Error("Invalid application: #{params.name}") - - .then -> - message = "Are you sure you want to associate #{currentDirectory} with #{params.name}?" - patterns.confirm(options.yes, message) - .then -> - - resin.models.application.get(params.name).get('git_repository').then (gitRepository) -> - vcs.initialize(currentDirectory).then -> - return vcs.associate(currentDirectory, gitRepository) - .then -> - console.info("git repository added: #{gitRepository}") - return gitRepository - - .nodeify(done) diff --git a/lib/app.coffee b/lib/app.coffee index d39a04b3..35969b48 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -38,7 +38,6 @@ capitano.command(actions.app.create) capitano.command(actions.app.list) capitano.command(actions.app.remove) capitano.command(actions.app.restart) -capitano.command(actions.app.associate) capitano.command(actions.app.info) # ---------- Device Module ----------