Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.12 KB

DollarFunction.md

File metadata and controls

49 lines (34 loc) · 1.12 KB

nodejsscriptDocs


nodejsscript / s / DollarFunction

Interface: DollarFunction()

DollarFunction(options): ShellString

Modifies config for next command in chain. The $() runs next command in silent mode:

// comapre bash
var=$(echo Hi)
echo $var
// with
const var= s.$().echo("Hi");
echo(var);

…examples:

const branch= s.$().run("git branch --show-current");
echo(branch);

s.$("-VF").run("gyt branch --show-current");

s.$("-g").rm("*.tx"); //remove only "*.txt" file

Parameters

options: "-f" | "-S" | "-V" | "-F" | "-g" | "-v" | "-s" | "-G"

Options - "-V": verbose - "-S": silent (default) - "-F": fatal - "-G": glob (evaluate * in paths) - to off option(s) use lower-case letters ("-v" no-verbose, "-s" …, …, "-g" noglob)

Returns

ShellString

DollarFunction(): ShellString

Returns

ShellString