Skip to content

Commit

Permalink
feat(stop): support --app argument
Browse files Browse the repository at this point in the history
  • Loading branch information
pdesoyres-cc committed Jun 21, 2024
1 parent 62428c9 commit 7d27b0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/clever.js
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ function run () {
const stop = lazyRequirePromiseModule('../src/commands/stop.js');
const stopCommand = cliparse.command('stop', {
description: 'Stop a running application',
options: [opts.alias],
options: [opts.alias, opts.appIdOrName],
}, stop('stop'));

// TCP-REDIRS COMMAND
Expand Down
6 changes: 3 additions & 3 deletions src/commands/stop.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

const AppConfig = require('../models/app_configuration.js');
const Application = require('../models/application.js');
const application = require('@clevercloud/client/cjs/api/v2/application.js');
const Logger = require('../logger.js');
const { sendToApi } = require('../models/send-to-api.js');

async function stop (params) {
const { alias } = params.options;
const { ownerId, appId } = await AppConfig.getAppDetails({ alias });
const { alias, app: appIdOrName } = params.options;
const { ownerId, appId } = await Application.resolveId(appIdOrName, alias);

await application.undeploy({ id: ownerId, appId }).then(sendToApi);
Logger.println('App successfully stopped!');
Expand Down

0 comments on commit 7d27b0b

Please sign in to comment.