Skip to content

Commit 6265da8

Browse files
committed
Update launch agent management
1 parent 9ec061c commit 6265da8

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Core/Sources/HostApp/LaunchAgentManager.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ extension LaunchAgentManager {
66
self.init(
77
serviceIdentifier: Bundle.main
88
.object(forInfoDictionaryKey: "BUNDLE_IDENTIFIER_BASE") as! String +
9-
".ExtensionService",
9+
".CommunicationBridge",
1010
executablePath: Bundle.main.bundleURL
1111
.appendingPathComponent("Contents")
1212
.appendingPathComponent("Applications")
13-
.appendingPathComponent(
14-
"CopilotForXcodeExtensionService.app/Contents/MacOS/CopilotForXcodeExtensionService"
15-
)
13+
.appendingPathComponent("CommunicationBridge")
1614
.path,
1715
bundleIdentifier: Bundle.main
1816
.object(forInfoDictionaryKey: "BUNDLE_IDENTIFIER_BASE") as! String
1917
)
2018
}
2119
}
20+

Core/Sources/LaunchAgentManager/LaunchAgentManager.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public struct LaunchAgentManager {
3939

4040
public func setupLaunchAgent() async throws {
4141
if #available(macOS 13, *) {
42-
let launchAgent = SMAppService.agent(plistName: "launchAgent.plist")
43-
try launchAgent.register()
42+
let bridgeLaunchAgent = SMAppService.agent(plistName: "bridgeLaunchAgent.plist")
43+
try bridgeLaunchAgent.register()
4444
} else {
4545
let content = """
4646
<?xml version="1.0" encoding="UTF-8"?>
@@ -84,8 +84,8 @@ public struct LaunchAgentManager {
8484

8585
public func removeLaunchAgent() async throws {
8686
if #available(macOS 13, *) {
87-
let launchAgent = SMAppService.agent(plistName: "launchAgent.plist")
88-
try await launchAgent.unregister()
87+
let bridgeLaunchAgent = SMAppService.agent(plistName: "bridgeLaunchAgent.plist")
88+
try await bridgeLaunchAgent.unregister()
8989
} else {
9090
try await launchctl("unload", launchAgentPath)
9191
try FileManager.default.removeItem(atPath: launchAgentPath)

EditorExtension/EditorExtension.entitlements

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
</array>
1111
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
1212
<array>
13+
<string>$(BUNDLE_IDENTIFIER_BASE).CommunicationBridge</string>
1314
<string>$(BUNDLE_IDENTIFIER_BASE).ExtensionService</string>
1415
</array>
1516
</dict>

0 commit comments

Comments
 (0)