File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ extension LaunchAgentManager {
1313 . appendingPathComponent (
1414 " CopilotForXcodeExtensionService.app/Contents/MacOS/CopilotForXcodeExtensionService "
1515 )
16- . path
16+ . path,
17+ bundleIdentifier: Bundle . main
18+ . object ( forInfoDictionaryKey: " BUNDLE_IDENTIFIER_BASE " ) as! String
1719 )
1820 }
1921}
Original file line number Diff line number Diff line change 11import Foundation
22
3+ #warning("TODO: Migrate to SMAppService")
34public struct LaunchAgentManager {
45 let lastLaunchAgentVersionKey = " LastLaunchAgentVersion "
56 let serviceIdentifier : String
67 let executablePath : String
8+ let bundleIdentifier : String
79
810 var launchAgentDirURL : URL {
911 FileManager . default. homeDirectoryForCurrentUser
@@ -14,9 +16,10 @@ public struct LaunchAgentManager {
1416 launchAgentDirURL. appendingPathComponent ( " \( serviceIdentifier) .plist " ) . path
1517 }
1618
17- public init ( serviceIdentifier: String , executablePath: String ) {
19+ public init ( serviceIdentifier: String , executablePath: String , bundleIdentifier : String ) {
1820 self . serviceIdentifier = serviceIdentifier
1921 self . executablePath = executablePath
22+ self . bundleIdentifier = bundleIdentifier
2023 }
2124
2225 public func setupLaunchAgentForTheFirstTimeIfNeeded( ) async throws {
@@ -44,6 +47,11 @@ public struct LaunchAgentManager {
4447 <key> \( serviceIdentifier) </key>
4548 <true/>
4649 </dict>
50+ <key>AssociatedBundleIdentifiers</key>
51+ <array>
52+ <string> \( bundleIdentifier) </string>
53+ <string> \( serviceIdentifier) </string>
54+ </array>
4755 </dict>
4856 </plist>
4957 """
You can’t perform that action at this time.
0 commit comments