Use separate socket for debug builds (#766)

This commit is contained in:
Max Goedjen
2025-11-29 13:32:34 -08:00
committed by GitHub
parent bb0b6d8dc3
commit 32a1a0bca9
6 changed files with 33 additions and 20 deletions

View File

@@ -4,6 +4,7 @@ import SecretKit
import Observation
import OSLog
import ServiceManagement
import Common
@MainActor protocol AgentLaunchControllerProtocol: Observable, Sendable {
var running: Bool { get }

View File

@@ -1,25 +0,0 @@
import Foundation
extension URL {
static var agentHomeURL: URL {
URL(fileURLWithPath: URL.homeDirectory.path().replacingOccurrences(of: Bundle.hostBundleID, with: Bundle.agentBundleID))
}
static var socketPath: String {
URL.agentHomeURL.appendingPathComponent("socket.ssh").path()
}
}
extension String {
var normalizedPathAndFolder: (String, String) {
// All foundation-based normalization methods replace this with the container directly.
let processedPath = replacingOccurrences(of: "~", with: "/Users/\(NSUserName())")
let url = URL(filePath: processedPath)
let folder = url.deletingLastPathComponent().path()
return (processedPath, folder)
}
}

View File

@@ -1,11 +0,0 @@
import Foundation
extension Bundle {
public static var agentBundleID: String {
Bundle.main.bundleIdentifier!.replacingOccurrences(of: "Host", with: "SecretAgent")
}
public static var hostBundleID: String {
Bundle.main.bundleIdentifier!.replacingOccurrences(of: "SecretAgent", with: "Host")
}
}