VoiceWake: pipe transcript to ssh forwarder
This commit is contained in:
@@ -138,8 +138,14 @@ enum VoiceWakeForwarder {
|
|||||||
}
|
}
|
||||||
args.append(userHost)
|
args.append(userHost)
|
||||||
|
|
||||||
let rendered = self.renderedCommand(template: config.commandTemplate, transcript: transcript)
|
let cmdTemplate: String
|
||||||
args.append(contentsOf: ["sh", "-c", self.commandWithCliPath(rendered, target: destination)])
|
if config.commandTemplate.contains("${text}") {
|
||||||
|
cmdTemplate = config.commandTemplate.replacingOccurrences(of: "${text}", with: "$CLAW_TEXT")
|
||||||
|
} else {
|
||||||
|
cmdTemplate = config.commandTemplate
|
||||||
|
}
|
||||||
|
let shellCommand = "CLAW_TEXT=$(cat); \(self.commandWithCliPath(cmdTemplate, target: destination))"
|
||||||
|
args.append(contentsOf: ["sh", "-c", shellCommand])
|
||||||
|
|
||||||
let debugCmd = (["/usr/bin/ssh"] + args).joined(separator: " ")
|
let debugCmd = (["/usr/bin/ssh"] + args).joined(separator: " ")
|
||||||
self.logger.info("voice wake ssh cmd=\(debugCmd, privacy: .public)")
|
self.logger.info("voice wake ssh cmd=\(debugCmd, privacy: .public)")
|
||||||
|
|||||||
Reference in New Issue
Block a user