-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplan.ts
More file actions
40 lines (31 loc) · 1.28 KB
/
plan.ts
File metadata and controls
40 lines (31 loc) · 1.28 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
import chalk from 'chalk';
import { BaseCommand } from '../common/base-command.js';
import { PlanOrchestrator } from '../orchestrators/plan.js';
export default class Plan extends BaseCommand {
static description =
`Generate an execution plan to apply changes from a codify.jsonc file.
This plan lists all the changes Codify needs to make to apply the codify.jsonc file.
The plan will not be executed. Behind the scenes, Codify performs a refresh scan to
determine the current configuration and installed resources, then compares them with
the desired configuration to compute the execution plan.
For scripts: use ${chalk.bold.bgMagenta(' --output json ')} which will skip all prompts and print
only the final result as a json.
For more information, visit: https://docs.codifycli.com/commands/plan`
static examples = [
'<%= config.bin %> <%= command.id %>',
'<%= config.bin %> <%= command.id %> -o json',
'<%= config.bin %> <%= command.id %> -p ../',
]
async init(): Promise<void> {
return super.init();
}
public async run(): Promise<void> {
const { flags } = await this.parse(Plan)
await PlanOrchestrator.run({
verbosityLevel: flags.debug ? 3 : 0,
path: flags.path,
secureMode: flags.secure,
}, this.reporter);
process.exit(0);
}
}