imcp 0.0.6 → 0.0.7
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.
|
@@ -48,17 +48,24 @@ export class ConfigurationProvider {
|
|
|
48
48
|
const configDir = path.dirname(this.configPath);
|
|
49
49
|
await fs.mkdir(configDir, { recursive: true });
|
|
50
50
|
try {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
try {
|
|
52
|
+
const config = JSON.parse(await fs.readFile(this.configPath, 'utf8'));
|
|
53
|
+
this.configuration = config;
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
if (error.code !== 'ENOENT') {
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
// File doesn't exist, use default empty configuration
|
|
60
|
+
await this.saveConfiguration();
|
|
61
|
+
}
|
|
62
|
+
// Always load feeds and client settings, whether file existed or not
|
|
63
|
+
await this.loadFeedsIntoConfiguration();
|
|
64
|
+
await this.loadClientMCPSettings();
|
|
55
65
|
}
|
|
56
66
|
catch (error) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
// File doesn't exist, use default empty configuration
|
|
61
|
-
await this.saveConfiguration();
|
|
67
|
+
Logger.error('Error during initialization', error);
|
|
68
|
+
throw error;
|
|
62
69
|
}
|
|
63
70
|
});
|
|
64
71
|
}
|
|
@@ -256,7 +263,7 @@ export class ConfigurationProvider {
|
|
|
256
263
|
});
|
|
257
264
|
}
|
|
258
265
|
Logger.debug('Updating local feeds...');
|
|
259
|
-
|
|
266
|
+
await fs.rm(LOCAL_FEEDS_DIR, { recursive: true, force: true });
|
|
260
267
|
const sourceFeedsDir = path.join(this.tempDir, GITHUB_REPO.feedsPath);
|
|
261
268
|
try {
|
|
262
269
|
await fs.access(sourceFeedsDir);
|
package/package.json
CHANGED
|
@@ -63,16 +63,23 @@ export class ConfigurationProvider {
|
|
|
63
63
|
await fs.mkdir(configDir, { recursive: true });
|
|
64
64
|
|
|
65
65
|
try {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
try {
|
|
67
|
+
const config = JSON.parse(await fs.readFile(this.configPath, 'utf8'));
|
|
68
|
+
this.configuration = config;
|
|
69
|
+
} catch (error) {
|
|
70
|
+
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
// File doesn't exist, use default empty configuration
|
|
74
|
+
await this.saveConfiguration();
|
|
73
75
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
|
|
77
|
+
// Always load feeds and client settings, whether file existed or not
|
|
78
|
+
await this.loadFeedsIntoConfiguration();
|
|
79
|
+
await this.loadClientMCPSettings();
|
|
80
|
+
} catch (error) {
|
|
81
|
+
Logger.error('Error during initialization', error);
|
|
82
|
+
throw error;
|
|
76
83
|
}
|
|
77
84
|
});
|
|
78
85
|
}
|
|
@@ -314,7 +321,7 @@ export class ConfigurationProvider {
|
|
|
314
321
|
}
|
|
315
322
|
|
|
316
323
|
Logger.debug('Updating local feeds...');
|
|
317
|
-
|
|
324
|
+
await fs.rm(LOCAL_FEEDS_DIR, { recursive: true, force: true });
|
|
318
325
|
const sourceFeedsDir = path.join(this.tempDir, GITHUB_REPO.feedsPath);
|
|
319
326
|
|
|
320
327
|
try {
|