File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const Table = require('cli-table3');
4
4
const { description } = require('../package.json');
5
5
const { globalConfig } = require("./config.js");
6
6
const os = require('os');
7
+ const Client = require("./client");
7
8
8
9
const cliConfig = {
9
10
verbose: false,
@@ -117,12 +118,13 @@ const parseError = (err) => {
117
118
if (cliConfig.report) {
118
119
(async () => {
119
120
let appwriteVersion = 'unknown';
120
- const isCloud = globalConfig.getEndpoint().includes('cloud.appwrite.io') ? 'Yes' : 'No';
121
+ const endpoint = globalConfig.getEndpoint();
122
+ const isCloud = endpoint.includes('cloud.appwrite.io') ? 'Yes' : 'No';
121
123
122
124
try {
123
- const res = await fetch(`${globalConfig.getEndpoint()}/health/version` );
124
- const json = await res.json( );
125
- appwriteVersion = json .version;
125
+ const client = new Client().setEndpoint(endpoint );
126
+ const res = await client.call('get', '/health/version' );
127
+ appwriteVersion = res .version;
126
128
} catch {
127
129
}
128
130
You can’t perform that action at this time.
0 commit comments