1 | import * as _ from 'lodash';
|
2 |
|
3 | import { readEnvironment } from './Helper/Env';
|
4 | import { startWizard } from './Helper/Wizard';
|
5 | import * as Step from './Steps';
|
6 |
|
7 | export async function run(argv: any): Promise<any> {
|
8 | const args = { ...argv, ...readEnvironment() };
|
9 | if (args.uninstall === undefined) {
|
10 | args.uninstall = false;
|
11 | }
|
12 | let steps = [
|
13 | Step.Initial,
|
14 | Step.Welcome,
|
15 | Step.ChooseIntegration,
|
16 | Step.ShouldConfigure,
|
17 | ];
|
18 | if (args.uninstall === false) {
|
19 | steps = _.concat(
|
20 | steps,
|
21 | Step.OpenSentry,
|
22 | Step.WaitForSentry,
|
23 | Step.SentryProjectSelector,
|
24 | Step.PromptForParameters,
|
25 | );
|
26 | }
|
27 | steps = _.concat(steps, Step.ConfigureProject, Step.Result);
|
28 | return startWizard(args, ...steps);
|
29 | }
|