We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29647a0 commit 3fe3545Copy full SHA for 3fe3545
src/cli/ssh-key.ts
@@ -5,7 +5,6 @@ import * as path from 'path';
5
import axios from 'axios';
6
import { utils } from 'ssh2';
7
import * as crypto from 'crypto';
8
-import { fileURLToPath } from 'url';
9
10
const API_BASE_URL = process.env.GIT_PROXY_API_URL || 'http://localhost:3000';
11
const GIT_PROXY_COOKIE_FILE = path.join(
@@ -167,7 +166,8 @@ Usage:
167
166
}
168
169
170
-// Execute main() only if this file is run directly (not imported in tests)
171
-if (process.argv[1] === fileURLToPath(import.meta.url)) {
+// Execute main() only if not in test environment
+// In tests, NODE_ENV is set to 'test' by vitest
+if (process.env.NODE_ENV !== 'test') {
172
main();
173
0 commit comments