Skip to content

Latest commit

 

History

History
56 lines (31 loc) · 1.12 KB

XargsFunction.md

File metadata and controls

56 lines (31 loc) · 1.12 KB

nodejsscriptDocs


nodejsscript / s / XargsFunction

Interface: XargsFunction()

XargsFunction<T>(options, cmd, ...cmd_args): ReturnType<T>

Works as xargs in bash, only -I option is supported.

s.run("git branch --show-current").xargs(s.run, "dep deploy --branch={}");
s.run("git branch --show-current").xargs({ "-I": "§" }, s.run, "dep deploy --branch=§");

xarg() by default escapes piped string, this can be off by passing -R option.

Type Parameters

T extends (...args) => any

Parameters

options: XargsOptions

Defaults to -I {}

cmd: T

ShellJS method from ShellReturnValue

• ...cmd_args: Parameters<T>

Arguments for cmd

Returns

ReturnType<T>

Result of cmd

XargsFunction<T>(cmd, ...cmd_args): ReturnType<T>

Type Parameters

T extends (...args) => any

Parameters

cmd: T

• ...cmd_args: Parameters<T>

Returns

ReturnType<T>