voice wake: use clean PATH (no inherited junk)

This commit is contained in:
Peter Steinberger
2025-12-07 16:33:56 +01:00
parent f3950a5a65
commit 45398b7660
2 changed files with 3 additions and 2 deletions

View File

@@ -34,7 +34,8 @@ enum VoiceWakeForwarder {
private static func cliLookupPrefix(target: String, echoPath: Bool) -> String {
let normalizedTarget = target.trimmingCharacters(in: .whitespacesAndNewlines)
let pathPrefix = "PATH=\(cliHelperSearchPaths.joined(separator: ":")):$PATH"
// Use a clean, deterministic PATH so remote shells with spaces or odd entries don't break.
let pathPrefix = "PATH=\(cliHelperSearchPaths.joined(separator: ":"))"
let searchList = self.cliSearchCandidates.joined(separator: " ")
var steps: [String] = [pathPrefix]

View File

@@ -32,7 +32,7 @@ import Testing
@Test func commandPrefersCliInstallPaths() {
let command = VoiceWakeForwarder.commandWithCliPath("clawdis-mac status", target: "user@host")
#expect(command.contains("PATH=\(cliHelperSearchPaths.joined(separator: ":")):$PATH"))
#expect(command.contains("PATH=\(cliHelperSearchPaths.joined(separator: ":"))"))
#expect(command.contains("for c in clawdis-mac /usr/local/bin/clawdis-mac /opt/homebrew/bin/clawdis-mac"))
#expect(command.contains("\"$CLI\" status"))
}