@codacy/codacy-mcp 0.6.15 → 0.6.17

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.
@@ -14,19 +14,9 @@ export class MacCodacyCli extends CodacyCli {
14
14
  this.setCliCommand(this._cliVersion ? `CODACY_CLI_V2_VERSION=${this._cliVersion} ${localPath}` : localPath);
15
15
  return;
16
16
  }
17
- // check if codacy-cli is installed globally
18
- try {
19
- // first set the command for the getCliCommand to do the right thing when called
20
- this.setCliCommand(this._cliVersion ? `CODACY_CLI_V2_VERSION=${this._cliVersion} codacy-cli` : 'codacy-cli');
21
- await this.execAsync(`${this.getCliCommand()} --help`);
22
- return;
23
- }
24
- catch {
25
- // CLI not found, clear it, and attempt to install it
26
- this.setCliCommand('');
27
- await this.install();
28
- return undefined;
29
- }
17
+ // CLI not found, attempt to install it
18
+ await this.install();
19
+ return;
30
20
  }
31
21
  async preflightCodacyCli() {
32
22
  // is there a command?
@@ -82,9 +72,13 @@ export class MacCodacyCli extends CodacyCli {
82
72
  async initialize() {
83
73
  // Check if the configuration files exist
84
74
  const configFilePath = path.join(this.rootPath, CODACY_FOLDER_NAME, 'codacy.yaml');
75
+ const cliConfigFilePath = path.join(this.rootPath, CODACY_FOLDER_NAME, 'cli-config.yaml');
85
76
  const toolsFolderPath = path.join(this.rootPath, CODACY_FOLDER_NAME, 'tools-configs');
86
- let needsInitialization = !fs.existsSync(configFilePath) || !fs.existsSync(toolsFolderPath);
87
- if (!needsInitialization) {
77
+ const initFilesOk = fs.existsSync(configFilePath) &&
78
+ fs.existsSync(cliConfigFilePath) &&
79
+ fs.existsSync(toolsFolderPath);
80
+ let needsInitialization = !initFilesOk;
81
+ if (initFilesOk) {
88
82
  // Check if the mode matches the current properties
89
83
  const cliConfig = fs.readFileSync(path.join(this.rootPath, CODACY_FOLDER_NAME, 'cli-config.yaml'), 'utf-8');
90
84
  if ((cliConfig === 'mode: local' && this.repository) ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/codacy-mcp",
3
- "version": "0.6.15",
3
+ "version": "0.6.17",
4
4
  "description": "Codacy MCP server",
5
5
  "license": "MIT",
6
6
  "author": "Codacy",