refactor: update macOS config paths

This commit is contained in:
Peter Steinberger
2025-12-23 23:45:27 +00:00
parent 364a6a9444
commit 5e07400cd1
5 changed files with 25 additions and 36 deletions

View File

@@ -61,22 +61,22 @@ enum ClawdisConfigFile {
self.saveDict(root)
}
static func inboundWorkspace() -> String? {
static func agentWorkspace() -> String? {
let root = self.loadDict()
let inbound = root["inbound"] as? [String: Any]
return inbound?["workspace"] as? String
let agent = root["agent"] as? [String: Any]
return agent?["workspace"] as? String
}
static func setInboundWorkspace(_ workspace: String?) {
static func setAgentWorkspace(_ workspace: String?) {
var root = self.loadDict()
var inbound = root["inbound"] as? [String: Any] ?? [:]
var agent = root["agent"] as? [String: Any] ?? [:]
let trimmed = workspace?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
if trimmed.isEmpty {
inbound.removeValue(forKey: "workspace")
agent.removeValue(forKey: "workspace")
} else {
inbound["workspace"] = trimmed
agent["workspace"] = trimmed
}
root["inbound"] = inbound
root["agent"] = agent
self.saveDict(root)
}
}