Skip to content

Commit 3fe3545

Browse files
committed
refactor: remove import meta
1 parent 29647a0 commit 3fe3545

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cli/ssh-key.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import * as path from 'path';
55
import axios from 'axios';
66
import { utils } from 'ssh2';
77
import * as crypto from 'crypto';
8-
import { fileURLToPath } from 'url';
98

109
const API_BASE_URL = process.env.GIT_PROXY_API_URL || 'http://localhost:3000';
1110
const GIT_PROXY_COOKIE_FILE = path.join(
@@ -167,7 +166,8 @@ Usage:
167166
}
168167
}
169168

170-
// Execute main() only if this file is run directly (not imported in tests)
171-
if (process.argv[1] === fileURLToPath(import.meta.url)) {
169+
// Execute main() only if not in test environment
170+
// In tests, NODE_ENV is set to 'test' by vitest
171+
if (process.env.NODE_ENV !== 'test') {
172172
main();
173173
}

0 commit comments

Comments
 (0)