mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
excmds.ts: Fix composite giving additional argument to first piped cmd
This commit is contained in:
parent
c4d1d9dcd2
commit
4f110f683d
1 changed files with 7 additions and 7 deletions
|
@ -1664,13 +1664,13 @@ export async function composite(...cmds: string[]) {
|
|||
.split(";")
|
||||
.reduce(
|
||||
async (_, cmd) => {
|
||||
return cmd.split("|").reduce(
|
||||
async (pipedValue, cmd) => {
|
||||
let [fn, args] = excmd_parser.parser(cmd)
|
||||
return fn.call({}, ...args, await pipedValue)
|
||||
},
|
||||
"" as any,
|
||||
)
|
||||
await _
|
||||
let cmds = cmd.split("|")
|
||||
let [fn, args] = excmd_parser.parser(cmd)
|
||||
return cmds.slice(1).reduce(async (pipedValue, cmd) => {
|
||||
let [fn, args] = excmd_parser.parser(cmd)
|
||||
return fn.call({}, ...args, await pipedValue)
|
||||
}, fn.call({}, ...args))
|
||||
},
|
||||
null as any,
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue