MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / openInFinder

Function openInFinder

packages/server/src/lib/fileLaunch.ts:153–173  ·  view source on GitHub ↗
(
  absolutePath: string,
  isDirectory: boolean | undefined,
  platform: NodeJS.Platform,
)

Source from the content-addressed store, hash-verified

151}
152
153function openInFinder(
154 absolutePath: string,
155 isDirectory: boolean | undefined,
156 platform: NodeJS.Platform,
157): LaunchCommand {
158 switch (platform) {
159 case 'darwin':
160 return isDirectory
161 ? { command: 'open', args: [absolutePath] }
162 : { command: 'open', args: ['-R', absolutePath] };
163 case 'win32':
164 return isDirectory
165 ? { command: 'explorer.exe', args: [absolutePath] }
166 : { command: 'explorer.exe', args: [`/select,${absolutePath}`] };
167 default:
168 return {
169 command: 'xdg-open',
170 args: [isDirectory ? absolutePath : path.dirname(absolutePath)],
171 };
172 }
173}
174
175function openInMacApp(
176 appName: string,

Callers 1

openInAppCommandForFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected