1 | #!/usr/bin/env node
|
2 | "use strict";
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
23 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
24 | };
|
25 | Object.defineProperty(exports, "__esModule", { value: true });
|
26 | const os_1 = __importDefault(require("os"));
|
27 | const config_1 = require("../src/config");
|
28 | const doctor_1 = require("../src/doctor");
|
29 | const wechaty_1 = require("../src/wechaty");
|
30 | const wechaty = wechaty_1.Wechaty.instance();
|
31 | const doctor = new doctor_1.Doctor();
|
32 | async function main() {
|
33 | let ipcTestResult;
|
34 | try {
|
35 | await doctor.testTcp();
|
36 | ipcTestResult = 'PASS';
|
37 | }
|
38 | catch (err) {
|
39 | console.info(err);
|
40 | ipcTestResult = 'FAIL. Please check your tcp network, Wechaty need to listen on localhost and connect to it.';
|
41 | }
|
42 | console.info(`
|
43 | #### Wechaty Doctor
|
44 |
|
45 | 1. Wechaty version: ${wechaty.version()}
|
46 | 2. ${os_1.default.type()} ${os_1.default.arch()} version ${os_1.default.release()} memory ${Math.floor(os_1.default.freemem() / 1024 / 1024)}/${Math.floor(os_1.default.totalmem() / 1024 / 1024)} MB
|
47 | 3. Docker: ${config_1.config.docker}
|
48 | 4. Node version: ${process.version}
|
49 | 5. Tcp IPC TEST: ${ipcTestResult}
|
50 |
|
51 | `);
|
52 | }
|
53 | main()
|
54 | .catch(err => console.error('main() exception: %s', err));
|
55 |
|
\ | No newline at end of file |