voice wake: use clean PATH (no inherited junk)
This commit is contained in:
@@ -34,7 +34,8 @@ enum VoiceWakeForwarder {
|
|||||||
|
|
||||||
private static func cliLookupPrefix(target: String, echoPath: Bool) -> String {
|
private static func cliLookupPrefix(target: String, echoPath: Bool) -> String {
|
||||||
let normalizedTarget = target.trimmingCharacters(in: .whitespacesAndNewlines)
|
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: " ")
|
let searchList = self.cliSearchCandidates.joined(separator: " ")
|
||||||
|
|
||||||
var steps: [String] = [pathPrefix]
|
var steps: [String] = [pathPrefix]
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import Testing
|
|||||||
|
|
||||||
@Test func commandPrefersCliInstallPaths() {
|
@Test func commandPrefersCliInstallPaths() {
|
||||||
let command = VoiceWakeForwarder.commandWithCliPath("clawdis-mac status", target: "user@host")
|
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("for c in clawdis-mac /usr/local/bin/clawdis-mac /opt/homebrew/bin/clawdis-mac"))
|
||||||
#expect(command.contains("\"$CLI\" status"))
|
#expect(command.contains("\"$CLI\" status"))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user