(programArguments: ReadonlyArray<string>)
| 248 | }; |
| 249 | |
| 250 | const associatedBundleIdentifier = (programArguments: ReadonlyArray<string>): string | null => { |
| 251 | const executablePath = programArguments[0]; |
| 252 | if (!executablePath) return null; |
| 253 | const appBundlePath = enclosingAppBundlePath(executablePath); |
| 254 | if (!appBundlePath) return null; |
| 255 | const bundleIdentifier = readBundleIdentifier(appBundlePath); |
| 256 | if (bundleIdentifier) return bundleIdentifier; |
| 257 | return /(?:^|\/)Executor\.app\/Contents\//.test(executablePath) |
| 258 | ? DESKTOP_APP_BUNDLE_IDENTIFIER |
| 259 | : null; |
| 260 | }; |
| 261 | |
| 262 | export interface LaunchdPlistOptions { |
| 263 | readonly label: string; |
no test coverage detected