Skip to content

Commit 4b128f8

Browse files
committed
fix: linter
1 parent 088806d commit 4b128f8

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

packages/gcloud-mcp/src/index.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ test('should exit if config file is invalid JSON', async () => {
155155
expect(process.exit).toHaveBeenCalledWith(1);
156156
});
157157

158-
159158
test('should exit if os is windows and it can not find working python', async () => {
160159
process.argv = ['node', 'index.js'];
161160
vi.spyOn(gcloud, 'isAvailable').mockResolvedValue(true);
@@ -168,14 +167,16 @@ test('should exit if os is windows and it can not find working python', async ()
168167
noWorkingPythonFound: true,
169168
env: {},
170169
},
171-
})
170+
});
172171
const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
173172
vi.stubGlobal('process', { ...process, exit: vi.fn(), on: vi.fn() });
174173

175174
await import('./index.js');
176175

177176
expect(consoleErrorSpy).toHaveBeenCalledWith(
178-
expect.stringContaining('Unable to start gcloud mcp server: No working Python installation found for Windows gcloud execution.'),
177+
expect.stringContaining(
178+
'Unable to start gcloud mcp server: No working Python installation found for Windows gcloud execution.',
179+
),
179180
);
180181
expect(process.exit).toHaveBeenCalledWith(1);
181-
});
182+
});

packages/gcloud-mcp/src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,15 @@ const main = async () => {
7979

8080
const cloudSDKSettings = await gcloud.getMemoizedCloudSDKSettings();
8181
// Platform verification
82-
if (cloudSDKSettings.isWindowsPlatform && (cloudSDKSettings.windowsCloudSDKSettings == null || cloudSDKSettings.windowsCloudSDKSettings.noWorkingPythonFound)) {
83-
log.error(`Unable to start gcloud mcp server: No working Python installation found for Windows gcloud execution.`);
84-
process.exit(1);
82+
if (
83+
cloudSDKSettings.isWindowsPlatform &&
84+
(cloudSDKSettings.windowsCloudSDKSettings == null ||
85+
cloudSDKSettings.windowsCloudSDKSettings.noWorkingPythonFound)
86+
) {
87+
log.error(
88+
`Unable to start gcloud mcp server: No working Python installation found for Windows gcloud execution.`,
89+
);
90+
process.exit(1);
8591
}
8692

8793
let config: McpConfig = {};

0 commit comments

Comments
 (0)