| 48 | }; |
| 49 | |
| 50 | const makeExecutorBundle = (bundleIdentifier: string): string => { |
| 51 | const root = mkdtempSync(join(tmpdir(), "executor-launchd-bundle-")); |
| 52 | tempDirs.push(root); |
| 53 | const contentsDir = join(root, "Executor.app", "Contents"); |
| 54 | const executableDir = join(contentsDir, "Resources", "executor"); |
| 55 | mkdirSync(executableDir, { recursive: true }); |
| 56 | writeFileSync( |
| 57 | join(contentsDir, "Info.plist"), |
| 58 | `<?xml version="1.0" encoding="UTF-8"?> |
| 59 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 60 | <plist version="1.0"> |
| 61 | <dict> |
| 62 | <key>CFBundleIdentifier</key> |
| 63 | <string>${bundleIdentifier}</string> |
| 64 | </dict> |
| 65 | </plist> |
| 66 | `, |
| 67 | ); |
| 68 | return join(executableDir, "executor"); |
| 69 | }; |
| 70 | |
| 71 | const expectLaunchdInvariants = (plist: string, input: typeof launchdInput): void => { |
| 72 | const programArguments = input.programArguments |