-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdestroy.ts
More file actions
57 lines (45 loc) · 1.66 KB
/
destroy.ts
File metadata and controls
57 lines (45 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import { BaseCommand } from '../common/base-command.js';
import { DestroyOrchestrator } from '../orchestrators/destroy.js';
export default class Destroy extends BaseCommand {
static strict = false;
static description =
`Use Codify to uninstall a supported package or setting on the system.
This command will only work for resources with Codify support. This command
can work with or without a codify.json file.
${chalk.bold('Modes:')}
• If a codify.json file exists, destroy the resource specified in the Codify.json file
with a matching type.
• If a codify.json file doesn't exist, additional information may be asked to identify
the specific resource to destroy.
For more information, visit: https://docs.codifycli.com/commands/destory`
static examples = [
'<%= config.bin %> <%= command.id %> homebrew nvm',
'<%= config.bin %> <%= command.id %> homebrew nvm --path=~',
'<%= config.bin %> <%= command.id %>',
]
static flags = {
'sudoPassword': Flags.string({
optional: true,
description: 'Automatically use this password for any commands that require elevated permissions.',
char: 'S',
helpValue: '<password>'
}),
}
public async run(): Promise<void> {
const { flags, raw } = await this.parse(Destroy)
const args = raw
.filter((r) => r.type === 'arg')
.map((r) => r.input);
if (flags.path) {
this.log(`Applying Codify from: ${flags.path}`);
}
await DestroyOrchestrator.run({
verbosityLevel: flags.debug ? 3 : 0,
typeIds: args,
path: flags.path,
}, this.reporter)
process.exit(0);
}
}