mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-01 23:02:26 +00:00
fix: pass arguments to commands without explicit placeholders (#9606)
This commit is contained in:
@@ -1627,8 +1627,15 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
||||
if (position === last) return args.slice(argIndex).join(" ")
|
||||
return args[argIndex]
|
||||
})
|
||||
const usesArgumentsPlaceholder = templateCommand.includes("$ARGUMENTS")
|
||||
let template = withArgs.replaceAll("$ARGUMENTS", input.arguments)
|
||||
|
||||
// If command doesn't explicitly handle arguments (no $N or $ARGUMENTS placeholders)
|
||||
// but user provided arguments, append them to the template
|
||||
if (placeholders.length === 0 && !usesArgumentsPlaceholder && input.arguments.trim()) {
|
||||
template = template + "\n\n" + input.arguments
|
||||
}
|
||||
|
||||
const shell = ConfigMarkdown.shell(template)
|
||||
if (shell.length > 0) {
|
||||
const results = await Promise.all(
|
||||
|
||||
Reference in New Issue
Block a user