@adinsure-ops/ops-cli 4.8.3 → 5.0.0-rc3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOGS.md +12 -0
- package/README.md +0 -211
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +6 -0
- package/bin/run.cmd +1 -1
- package/bin/run.js +8 -0
- package/lib/command.base.d.ts +9 -5
- package/lib/command.base.jira.d.ts +7 -8
- package/lib/command.base.jira.js +26 -24
- package/lib/command.base.js +69 -57
- package/lib/commands/docker/update-image-version.d.ts +6 -9
- package/lib/commands/docker/update-image-version.js +35 -34
- package/lib/commands/doctor.d.ts +15 -5
- package/lib/commands/doctor.js +219 -186
- package/lib/commands/download/client.d.ts +10 -7
- package/lib/commands/download/client.js +60 -52
- package/lib/commands/download/identity-server.d.ts +9 -7
- package/lib/commands/download/identity-server.js +59 -53
- package/lib/commands/download/jmeter.d.ts +5 -5
- package/lib/commands/download/jmeter.js +54 -49
- package/lib/commands/download/keycloak-scim.d.ts +6 -6
- package/lib/commands/download/keycloak-scim.js +56 -51
- package/lib/commands/download/platform.d.ts +9 -7
- package/lib/commands/download/platform.js +59 -53
- package/lib/commands/download/scheduler.d.ts +9 -7
- package/lib/commands/download/scheduler.js +59 -53
- package/lib/commands/download/server.d.ts +9 -7
- package/lib/commands/download/server.js +59 -53
- package/lib/commands/download/signalr.d.ts +9 -7
- package/lib/commands/download/signalr.js +59 -53
- package/lib/commands/download/studio.d.ts +11 -9
- package/lib/commands/download/studio.js +92 -82
- package/lib/commands/gitlab/get-tag-pipeline.d.ts +11 -14
- package/lib/commands/gitlab/get-tag-pipeline.js +95 -92
- package/lib/commands/gitlab/next-nightly-tag.d.ts +10 -12
- package/lib/commands/gitlab/next-nightly-tag.js +96 -98
- package/lib/commands/jira/issue.d.ts +6 -8
- package/lib/commands/jira/issue.js +25 -23
- package/lib/commands/jira/labels.d.ts +9 -12
- package/lib/commands/jira/labels.js +52 -51
- package/lib/commands/log/add.d.ts +6 -8
- package/lib/commands/log/add.js +92 -87
- package/lib/commands/log/generate.d.ts +9 -10
- package/lib/commands/log/generate.js +112 -107
- package/lib/commands/log/validate.d.ts +2 -2
- package/lib/commands/log/validate.js +47 -43
- package/lib/commands/login.d.ts +9 -10
- package/lib/commands/login.js +101 -97
- package/lib/commands/npm/check-publish.d.ts +7 -8
- package/lib/commands/npm/check-publish.js +59 -54
- package/lib/commands/npm/dependency-update.d.ts +14 -12
- package/lib/commands/npm/dependency-update.js +94 -86
- package/lib/commands/npm/publish.d.ts +8 -9
- package/lib/commands/npm/publish.js +154 -140
- package/lib/commands/nuget/dependency-update.d.ts +15 -10
- package/lib/commands/nuget/dependency-update.js +60 -49
- package/lib/commands/sql.d.ts +24 -20
- package/lib/commands/sql.js +245 -226
- package/lib/commands/translate.d.ts +15 -16
- package/lib/commands/translate.js +109 -104
- package/lib/commands/version.d.ts +29 -19
- package/lib/commands/version.js +215 -190
- package/lib/config.js +3 -6
- package/lib/hooks/init/version-override.d.ts +2 -2
- package/lib/hooks/init/version-override.js +15 -13
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -4
- package/lib/lib/command.d.ts +2 -0
- package/lib/lib/command.js +65 -58
- package/lib/lib/gitlab.d.ts +8 -2
- package/lib/lib/gitlab.js +94 -82
- package/lib/lib/npm.d.ts +7 -3
- package/lib/lib/npm.js +72 -60
- package/lib/lib/npmrc.d.ts +5 -0
- package/lib/lib/npmrc.js +20 -13
- package/lib/lib/nuget.d.ts +2 -0
- package/lib/lib/nuget.js +20 -17
- package/lib/security/cache.js +31 -27
- package/lib/security/context.d.ts +2 -1
- package/lib/security/context.js +106 -103
- package/lib/types/changelog.types.js +1 -2
- package/lib/types/npm.types.d.ts +5 -5
- package/lib/types/npm.types.js +1 -2
- package/oclif.manifest.json +1212 -1
- package/package.json +50 -46
- package/bin/run +0 -5
- package/lib/commands/prepare-content.d.ts +0 -29
- package/lib/commands/prepare-content.js +0 -386
package/lib/commands/doctor.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import CommandBase from '../command.base';
|
|
2
|
-
export default class Doctor extends CommandBase {
|
|
1
|
+
import CommandBase from '../command.base.js';
|
|
2
|
+
export default class Doctor extends CommandBase<typeof Doctor> {
|
|
3
3
|
static description: string;
|
|
4
4
|
static usage: string;
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
|
-
fix: import("@oclif/
|
|
7
|
+
fix: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
8
|
};
|
|
9
9
|
private readonly cp;
|
|
10
10
|
private nvm;
|
|
11
11
|
private yarn;
|
|
12
12
|
private node;
|
|
13
|
-
private
|
|
13
|
+
private missingPackages;
|
|
14
14
|
/**
|
|
15
|
-
* Check if
|
|
15
|
+
* Check if Git is installed
|
|
16
|
+
* @param {boolean} fix Try to install Git if found missing
|
|
17
|
+
* @returns {void}
|
|
16
18
|
*/
|
|
17
19
|
gitCheck(fix: boolean): Promise<void>;
|
|
18
20
|
gitInstall(): Promise<void>;
|
|
@@ -20,26 +22,34 @@ export default class Doctor extends CommandBase {
|
|
|
20
22
|
gitWindowsInstall(): Promise<void>;
|
|
21
23
|
/**
|
|
22
24
|
* Check if nvm is installed
|
|
25
|
+
* @returns {void}
|
|
23
26
|
*/
|
|
24
27
|
nvmCheck(): Promise<void>;
|
|
25
28
|
/**
|
|
26
29
|
* Check which node is installed
|
|
30
|
+
* @param {boolean} fix Try to install Node if found missing
|
|
31
|
+
* @returns {void}
|
|
27
32
|
*/
|
|
28
33
|
nodeCheck(fix: boolean): Promise<void>;
|
|
29
34
|
/**
|
|
30
35
|
* Check which node is installed
|
|
36
|
+
* @returns {void}
|
|
31
37
|
*/
|
|
32
38
|
nodeInstall(): Promise<void>;
|
|
33
39
|
/**
|
|
34
40
|
* Check which yarn is installed
|
|
41
|
+
* @param {boolean} fix Try to install yarn if found missing
|
|
42
|
+
* @returns {void}
|
|
35
43
|
*/
|
|
36
44
|
yarnCheck(fix: boolean): Promise<void>;
|
|
37
45
|
/**
|
|
38
46
|
* Check which yarn is installed
|
|
47
|
+
* @returns {void}
|
|
39
48
|
*/
|
|
40
49
|
yarnInstall(): Promise<void>;
|
|
41
50
|
/**
|
|
42
51
|
* Check which VSCode is installed
|
|
52
|
+
* @returns {void}
|
|
43
53
|
*/
|
|
44
54
|
vscodeCheck(): Promise<void>;
|
|
45
55
|
run(): Promise<void>;
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1,257 +1,290 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const command_2 = require("../lib/command");
|
|
9
|
-
class Doctor extends command_base_1.default {
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Flags, ux } from '@oclif/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
import CommandBase from '../command.base.js';
|
|
6
|
+
import ChildProcessCommand from '../lib/command.js';
|
|
7
|
+
class Doctor extends CommandBase {
|
|
10
8
|
constructor() {
|
|
11
9
|
super(...arguments);
|
|
12
|
-
this.cp = new
|
|
10
|
+
this.cp = new ChildProcessCommand();
|
|
13
11
|
this.nvm = false;
|
|
14
12
|
this.yarn = false;
|
|
15
13
|
this.node = false;
|
|
16
|
-
this.
|
|
14
|
+
this.missingPackages = 0;
|
|
17
15
|
}
|
|
18
16
|
/**
|
|
19
|
-
* Check if
|
|
17
|
+
* Check if Git is installed
|
|
18
|
+
* @param {boolean} fix Try to install Git if found missing
|
|
19
|
+
* @returns {void}
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
catch (_a) {
|
|
34
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.red('git is missing')}`);
|
|
35
|
-
if (fix) {
|
|
36
|
-
await this.gitInstall();
|
|
21
|
+
gitCheck(fix) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
ux.action.start('Checking git', undefined, { stdout: true });
|
|
24
|
+
try {
|
|
25
|
+
const output = yield this.cp.runCommand(['git', '--version']);
|
|
26
|
+
if (output.error) {
|
|
27
|
+
ux.action.stop(`${chalk.red(output.error)}`);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const version = output.data.split(' ')[2].split('\n')[0];
|
|
31
|
+
ux.action.stop(`${chalk.green(version)}`);
|
|
32
|
+
}
|
|
37
33
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
catch (_a) {
|
|
35
|
+
ux.action.stop(`${chalk.red('git is missing')}`);
|
|
36
|
+
if (fix) {
|
|
37
|
+
yield this.gitInstall();
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.missingPackages++;
|
|
41
|
+
this.warn(`Looks like git is missing.
|
|
41
42
|
Official documentation on how to install git can be found here: (https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)`);
|
|
43
|
+
}
|
|
42
44
|
}
|
|
43
|
-
}
|
|
45
|
+
});
|
|
44
46
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
gitInstall() {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
switch (process.platform) {
|
|
50
|
+
case 'linux': {
|
|
51
|
+
yield this.gitLinuxInstall();
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case 'win32': {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
default: {
|
|
58
|
+
this.warn('unsupported platform. skipping git install.');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
55
62
|
}
|
|
56
|
-
|
|
57
|
-
this
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
gitLinuxInstall() {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
this.log(`Try to install git on ubuntu. Sudo is required`);
|
|
66
|
+
try {
|
|
67
|
+
yield this.cp.runCommand(['sudo', 'apt', 'update']);
|
|
68
|
+
yield this.cp.runCommand(['sudo', 'apt', 'install', 'git']);
|
|
69
|
+
yield this.gitCheck(false);
|
|
70
|
+
}
|
|
71
|
+
catch (_a) {
|
|
72
|
+
ux.action.stop(`${chalk.red('error installing git.')}`);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
66
75
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
gitWindowsInstall() {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
// https://github.com/git-for-windows/git/releases/download/v2.33.1.windows.1/Git-2.33.1-64-bit.exe
|
|
79
|
+
// %USERPROFILE%\Downloads
|
|
80
|
+
});
|
|
70
81
|
}
|
|
71
82
|
/**
|
|
72
83
|
* Check if nvm is installed
|
|
84
|
+
* @returns {void}
|
|
73
85
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (process.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
nvmCheck() {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
ux.action.start('Checking nvm', undefined, { stdout: true });
|
|
89
|
+
if (process.platform !== 'win32') {
|
|
90
|
+
if (process.env.NVM_DIR) {
|
|
91
|
+
try {
|
|
92
|
+
const data = yield fs.readJSON(`${process.env.NVM_DIR}/package.json`);
|
|
93
|
+
ux.action.stop(`${chalk.green(data.version)}`);
|
|
94
|
+
this.nvm = true;
|
|
95
|
+
}
|
|
96
|
+
catch (_a) {
|
|
97
|
+
ux.action.stop(`${chalk.red('not installed')}`);
|
|
98
|
+
}
|
|
82
99
|
}
|
|
83
|
-
|
|
84
|
-
|
|
100
|
+
else {
|
|
101
|
+
ux.action.stop(`${chalk.red('nvm is missing (install manually from https://github.com/nvm-sh/nvm#installing-and-updating')}`);
|
|
85
102
|
}
|
|
103
|
+
return;
|
|
86
104
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
105
|
+
try {
|
|
106
|
+
const output = yield this.cp.runCommand(['nvm', 'version']);
|
|
107
|
+
if (output.error) {
|
|
108
|
+
ux.action.stop(`${chalk.red(output.error)}`);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
const version = output.data.split('\n')[0];
|
|
112
|
+
this.nvm = true;
|
|
113
|
+
ux.action.stop(`${chalk.green(version)}`);
|
|
114
|
+
}
|
|
96
115
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this.nvm = true;
|
|
100
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.green(version)}`);
|
|
116
|
+
catch (_b) {
|
|
117
|
+
ux.action.stop(`${chalk.red('nvm is missing (install manually from https://github.com/coreybutler/nvm-windows/releases)')}`);
|
|
101
118
|
}
|
|
102
|
-
}
|
|
103
|
-
catch (_b) {
|
|
104
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.red('nvm is missing (install manually from https://github.com/coreybutler/nvm-windows/releases)')}`);
|
|
105
|
-
}
|
|
119
|
+
});
|
|
106
120
|
}
|
|
107
121
|
/**
|
|
108
122
|
* Check which node is installed
|
|
123
|
+
* @param {boolean} fix Try to install Node if found missing
|
|
124
|
+
* @returns {void}
|
|
109
125
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
else {
|
|
118
|
-
let version = output.data.split('\n')[0];
|
|
119
|
-
if (version) {
|
|
120
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.green(version)}`);
|
|
121
|
-
this.node = true;
|
|
122
|
-
// only check yarn if node is installed
|
|
123
|
-
await this.yarnCheck(fix);
|
|
126
|
+
nodeCheck(fix) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
ux.action.start('Checking node', undefined, { stdout: true });
|
|
129
|
+
try {
|
|
130
|
+
const output = yield this.cp.runCommand(['node', '--version']);
|
|
131
|
+
if (output.error) {
|
|
132
|
+
ux.action.stop(`${chalk.red(output.error)}`);
|
|
124
133
|
}
|
|
125
134
|
else {
|
|
126
|
-
|
|
135
|
+
const version = output.data.split('\n')[0];
|
|
136
|
+
if (version) {
|
|
137
|
+
ux.action.stop(`${chalk.green(version)}`);
|
|
138
|
+
this.node = true;
|
|
139
|
+
// only check yarn if node is installed
|
|
140
|
+
yield this.yarnCheck(fix);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
ux.action.stop(`${chalk.red('failed getting version')}`);
|
|
144
|
+
}
|
|
127
145
|
}
|
|
128
146
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
catch (_a) {
|
|
148
|
+
ux.action.stop(`${chalk.red('node is missing')}`);
|
|
149
|
+
if (fix && this.nvm) {
|
|
150
|
+
yield this.nodeInstall();
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
this.missingPackages++;
|
|
154
|
+
}
|
|
137
155
|
}
|
|
138
|
-
}
|
|
156
|
+
});
|
|
139
157
|
}
|
|
140
158
|
/**
|
|
141
159
|
* Check which node is installed
|
|
160
|
+
* @returns {void}
|
|
142
161
|
*/
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
try {
|
|
149
|
-
let output = await this.cp.runCommand(['nvm', 'install', '15.6.0']);
|
|
150
|
-
if (output.error) {
|
|
151
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.red(output.error)}`);
|
|
162
|
+
nodeInstall() {
|
|
163
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
ux.action.start('installing node 15.6.0', undefined, { stdout: true });
|
|
165
|
+
if (!this.nvm) {
|
|
166
|
+
return ux.action.stop(`${chalk.red('only works with nvm isntalled')}`);
|
|
152
167
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if (
|
|
156
|
-
|
|
168
|
+
try {
|
|
169
|
+
const output = yield this.cp.runCommand(['nvm', 'install', '15.6.0']);
|
|
170
|
+
if (output.error) {
|
|
171
|
+
ux.action.stop(`${chalk.red(output.error)}`);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
const nvmUserOutput = yield this.cp.runCommand(['nvm', 'use', '15.6.0']);
|
|
175
|
+
if (nvmUserOutput.error) {
|
|
176
|
+
ux.action.stop(`${chalk.red(output.error)}`);
|
|
177
|
+
}
|
|
178
|
+
ux.action.stop(`${chalk.green('Done')}`);
|
|
157
179
|
}
|
|
158
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.green('Done')}`);
|
|
159
180
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
181
|
+
catch (_a) {
|
|
182
|
+
ux.action.stop(`${chalk.red('failed')}`);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
164
185
|
}
|
|
165
186
|
/**
|
|
166
187
|
* Check which yarn is installed
|
|
188
|
+
* @param {boolean} fix Try to install yarn if found missing
|
|
189
|
+
* @returns {void}
|
|
167
190
|
*/
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
else {
|
|
176
|
-
let version = output.data.split('\n')[0];
|
|
177
|
-
if (version) {
|
|
178
|
-
this.yarn = true;
|
|
179
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.green(version)}`);
|
|
191
|
+
yarnCheck(fix) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
ux.action.start('Checking yarn', undefined, { stdout: true });
|
|
194
|
+
try {
|
|
195
|
+
const output = yield this.cp.runCommand(['yarn', '--version']);
|
|
196
|
+
if (output.error) {
|
|
197
|
+
ux.action.stop(`${chalk.red(output.error)}`);
|
|
180
198
|
}
|
|
181
199
|
else {
|
|
182
|
-
|
|
200
|
+
const version = output.data.split('\n')[0];
|
|
201
|
+
if (version) {
|
|
202
|
+
this.yarn = true;
|
|
203
|
+
ux.action.stop(`${chalk.green(version)}`);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
ux.action.stop(`${chalk.red('yarn is missing')}`);
|
|
207
|
+
}
|
|
183
208
|
}
|
|
184
209
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
210
|
+
catch (_a) {
|
|
211
|
+
this.missingPackages++;
|
|
212
|
+
ux.action.stop(`${chalk.red('yarn is missing')}`);
|
|
213
|
+
if (fix) {
|
|
214
|
+
yield this.yarnInstall();
|
|
215
|
+
}
|
|
191
216
|
}
|
|
192
|
-
}
|
|
217
|
+
});
|
|
193
218
|
}
|
|
194
219
|
/**
|
|
195
220
|
* Check which yarn is installed
|
|
221
|
+
* @returns {void}
|
|
196
222
|
*/
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
223
|
+
yarnInstall() {
|
|
224
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
+
ux.action.start('Install yarn', undefined, { stdout: true });
|
|
226
|
+
try {
|
|
227
|
+
const output = yield this.cp.runCommand(['npm', '-g', 'install', 'yarn']);
|
|
228
|
+
if (output.error) {
|
|
229
|
+
ux.action.stop(`${chalk.red(output.error)}`);
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
this.yarn = true;
|
|
233
|
+
ux.action.stop(`${chalk.green('yarn installed')}`);
|
|
234
|
+
}
|
|
203
235
|
}
|
|
204
|
-
|
|
205
|
-
this.
|
|
206
|
-
|
|
236
|
+
catch (_a) {
|
|
237
|
+
this.missingPackages++;
|
|
238
|
+
ux.action.stop(`${chalk.red('yarn failed to install')}`);
|
|
207
239
|
}
|
|
208
|
-
}
|
|
209
|
-
catch (_a) {
|
|
210
|
-
this.missing_packages++;
|
|
211
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.red('yarn failed to install')}`);
|
|
212
|
-
}
|
|
240
|
+
});
|
|
213
241
|
}
|
|
214
242
|
/**
|
|
215
243
|
* Check which VSCode is installed
|
|
244
|
+
* @returns {void}
|
|
216
245
|
*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
246
|
+
vscodeCheck() {
|
|
247
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
+
ux.action.start('Checking vscode', undefined, { stdout: true });
|
|
249
|
+
try {
|
|
250
|
+
const output = yield this.cp.runCommand(['code', '--version']);
|
|
251
|
+
if (output.error) {
|
|
252
|
+
ux.action.stop(`${chalk.red(output.error)}`);
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
const version = output.data.split('\n')[0];
|
|
256
|
+
ux.action.stop(`${chalk.green(version)}`);
|
|
257
|
+
}
|
|
223
258
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
259
|
+
catch (_a) {
|
|
260
|
+
this.missingPackages++;
|
|
261
|
+
ux.action.stop(`${chalk.red('VSCode not installed')}`);
|
|
227
262
|
}
|
|
228
|
-
}
|
|
229
|
-
catch (_a) {
|
|
230
|
-
this.missing_packages++;
|
|
231
|
-
cli_ux_1.default.action.stop(`${chalk_1.default.red('VSCode not installed')}`);
|
|
232
|
-
}
|
|
263
|
+
});
|
|
233
264
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
this.
|
|
242
|
-
|
|
265
|
+
run() {
|
|
266
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
267
|
+
const { flags } = yield this.parse(Doctor);
|
|
268
|
+
yield this.gitCheck(flags.fix);
|
|
269
|
+
yield this.nvmCheck();
|
|
270
|
+
yield this.nodeCheck(flags.fix);
|
|
271
|
+
yield this.vscodeCheck();
|
|
272
|
+
if (this.missingPackages > 0) {
|
|
273
|
+
this.warn(`${chalk.yellow('Some packages are missing. Try --fix to automatically install.')}`);
|
|
274
|
+
}
|
|
275
|
+
});
|
|
243
276
|
}
|
|
244
277
|
}
|
|
245
|
-
exports.default = Doctor;
|
|
246
278
|
Doctor.description = 'check if everything is installed';
|
|
247
279
|
Doctor.usage = 'doctor';
|
|
248
280
|
Doctor.examples = [
|
|
249
|
-
`$ ops doctor
|
|
281
|
+
`$ ops doctor`,
|
|
250
282
|
];
|
|
251
283
|
Doctor.flags = {
|
|
252
|
-
fix:
|
|
284
|
+
fix: Flags.boolean({
|
|
253
285
|
char: 'p',
|
|
254
286
|
description: 'try to install missing packages',
|
|
255
|
-
default: false
|
|
256
|
-
})
|
|
287
|
+
default: false,
|
|
288
|
+
}),
|
|
257
289
|
};
|
|
290
|
+
export default Doctor;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import CommandBase from '../../command.base';
|
|
3
|
-
export default class DownloadClient extends CommandBase {
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import CommandBase from '../../command.base.js';
|
|
3
|
+
export default class DownloadClient extends CommandBase<typeof DownloadClient> {
|
|
4
|
+
static aliases: string[];
|
|
4
5
|
static description: string;
|
|
5
6
|
static usage: string;
|
|
6
7
|
static examples: string[];
|
|
7
8
|
static flags: {
|
|
8
|
-
version:
|
|
9
|
-
output:
|
|
9
|
+
version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
11
|
};
|
|
11
12
|
private readonly url;
|
|
12
13
|
/**
|
|
13
|
-
* Get unique
|
|
14
|
+
* Get unique AdInsure Client zip by specified version
|
|
15
|
+
* @param {string} version The version of AdInsure Client
|
|
16
|
+
* @returns {Promise<AxiosResponse<any, any>>}
|
|
14
17
|
*/
|
|
15
|
-
downloadFile(version: string): Promise<
|
|
18
|
+
downloadFile(version: string): Promise<AxiosResponse<any, any>>;
|
|
16
19
|
run(): Promise<void>;
|
|
17
20
|
}
|