@codacy/codacy-mcp 0.6.4 → 0.6.5
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.
|
@@ -9,6 +9,11 @@ const CLI_LOCAL_COMMAND = `${CLI_FOLDER_NAME}/${CLI_FILE_NAME}`;
|
|
|
9
9
|
const CLI_GLOBAL_COMMAND = 'codacy-cli';
|
|
10
10
|
// Set a larger buffer size (10MB)
|
|
11
11
|
const MAX_BUFFER_SIZE = 1024 * 1024 * 10;
|
|
12
|
+
// Function to detect if user is on Windows
|
|
13
|
+
const isWindows = () => {
|
|
14
|
+
const isWindows = process.platform === 'win32';
|
|
15
|
+
return isWindows;
|
|
16
|
+
};
|
|
12
17
|
const execAsync = (command, options) => {
|
|
13
18
|
return new Promise((resolve, reject) => {
|
|
14
19
|
exec(`${CODACY_CLI_VERSION ? `CODACY_CLI_V2_VERSION=${CODACY_CLI_VERSION} ` : ''}${command}`, {
|
|
@@ -90,6 +95,14 @@ const ensureCodacyCLIExists = async (rootPath, provider, organization, repositor
|
|
|
90
95
|
return CLI_LOCAL_COMMAND;
|
|
91
96
|
};
|
|
92
97
|
export const cliAnalyzeHandler = async (args) => {
|
|
98
|
+
if (isWindows()) {
|
|
99
|
+
// If the user is on Windows return an error message
|
|
100
|
+
return {
|
|
101
|
+
success: false,
|
|
102
|
+
errorType: 'cli-unsupported-os',
|
|
103
|
+
output: 'Codacy CLI is only available on Windows via WSL (Windows Subsystem for Linux).',
|
|
104
|
+
};
|
|
105
|
+
}
|
|
93
106
|
try {
|
|
94
107
|
// Ensure codacy-cli is installed
|
|
95
108
|
const cliCommand = await ensureCodacyCLIExists(args.rootPath, args.provider, args.organization, args.repository);
|