@asyncapi/cli 1.15.4 → 1.16.0
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/lib/base.js +1 -1
- package/lib/commands/config/analytics.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/lib/base.js
CHANGED
|
@@ -127,7 +127,7 @@ class default_1 extends core_1.Command {
|
|
|
127
127
|
recorderFromEnv(prefix) {
|
|
128
128
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
129
129
|
let sink = new DiscardSink();
|
|
130
|
-
const analyticsConfigFile = (0, path_1.join)((0, os_1.homedir)(), '.asyncapi-analytics');
|
|
130
|
+
const analyticsConfigFile = process.env.ASYNCAPI_METRICS_CONFIG_PATH || (0, path_1.join)((0, os_1.homedir)(), '.asyncapi-analytics');
|
|
131
131
|
if (!(0, fs_extra_1.existsSync)(analyticsConfigFile)) {
|
|
132
132
|
yield writeFile(analyticsConfigFile, JSON.stringify({ analyticsEnabled: 'true', infoMessageShown: 'false', userID: (0, uuid_1.v4)() }), { encoding: 'utf8' });
|
|
133
133
|
}
|
|
@@ -11,7 +11,7 @@ class Analytics extends base_1.default {
|
|
|
11
11
|
run() {
|
|
12
12
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
13
|
const { flags } = yield this.parse(Analytics);
|
|
14
|
-
const analyticsConfigFile = (0, path_1.join)((0, os_1.homedir)(), '.asyncapi-analytics');
|
|
14
|
+
const analyticsConfigFile = process.env.ASYNCAPI_METRICS_CONFIG_PATH || (0, path_1.join)((0, os_1.homedir)(), '.asyncapi-analytics');
|
|
15
15
|
try {
|
|
16
16
|
const analyticsConfigFileContent = JSON.parse(yield readFile((0, path_1.resolve)(analyticsConfigFile), { encoding: 'utf8' }));
|
|
17
17
|
if (flags.disable) {
|
|
@@ -39,7 +39,7 @@ class Analytics extends base_1.default {
|
|
|
39
39
|
catch (e) {
|
|
40
40
|
switch (e.code) {
|
|
41
41
|
case 'ENOENT':
|
|
42
|
-
this.error(`Unable to access the analytics configuration file. We tried to access the ".asyncapi-analytics" file in
|
|
42
|
+
this.error(`Unable to access the analytics configuration file. We tried to access the ".asyncapi-analytics" file in in the path "${analyticsConfigFile}" but the file could not be found.`);
|
|
43
43
|
break;
|
|
44
44
|
case 'EEXIST':
|
|
45
45
|
this.error(`Unable to update the analytics configuration file. We tried to update your ".asyncapi-analytics" file in the path "${analyticsConfigFile}" but the file does not exist.`);
|
package/oclif.manifest.json
CHANGED