balena-cli
Version:
The official balena Command Line Interface
41 lines (39 loc) • 1.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const cf = require("../../utils/common-flags");
const lazy_1 = require("../../utils/lazy");
class OrganizationRmCmd extends core_1.Command {
async run() {
const { args: params, flags: options } = await this.parse(OrganizationRmCmd);
const balena = (0, lazy_1.getBalenaSdk)();
const patterns = await Promise.resolve().then(() => require('../../utils/patterns'));
const org = await balena.models.organization.get(params.handle, {
$select: ['id', 'name'],
});
await patterns.confirm(options.yes, `Are you sure you want to delete organization '${org.name}' with handle '${params.handle}' ?`);
await balena.models.organization.remove(org.id);
}
}
OrganizationRmCmd.description = (0, lazy_1.stripIndent) `
Remove an organizations.
Remove an organizations from balena.
Note this command asks for confirmation interactively.
You can avoid this by passing the \`--yes\` option.
`;
OrganizationRmCmd.examples = [
'$ balena organization rm my_org_handle',
'$ balena organization rm my_org_handle --yes',
];
OrganizationRmCmd.args = {
handle: core_1.Args.string({
description: 'the handle of the organization to delete',
required: true,
}),
};
OrganizationRmCmd.flags = {
yes: cf.yes(),
};
OrganizationRmCmd.authenticated = true;
exports.default = OrganizationRmCmd;
//# sourceMappingURL=rm.js.map