MCPcopy Create free account
hub / github.com/MicrosoftDocs/mcp / resolveMainModuleUrl

Function resolveMainModuleUrl

cli/src/index.ts:105–115  ·  view source on GitHub ↗
(argv1: string | undefined = process.argv[1])

Source from the content-addressed store, hash-verified

103}
104
105function isZeroExitError(error: unknown): boolean {
106 return typeof error === 'object' && error !== null && 'exitCode' in error && (error as { exitCode?: unknown }).exitCode === 0;
107}
108
109export function resolveMainModuleUrl(argv1: string | undefined = process.argv[1]): string {
110 try {
111 return pathToFileURL(realpathSync(argv1 ?? '')).href;
112 } catch {
113 try {
114 return pathToFileURL(argv1 ?? '').href;
115 } catch {
116 return '';
117 }
118 }

Callers 1

index.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected