MCPcopy
hub / github.com/shelljs/shx / printCmdRet

Function printCmdRet

src/printCmdRet.js:3–12  ·  view source on GitHub ↗
(ret)

Source from the content-addressed store, hash-verified

1// This function takes the raw result of a shelljs command and figures out how to print it.
2// Invoke this *REGARDLESS* of what the command returns, it will figure it out.
3export const printCmdRet = (ret) => {
4 // Don't print these types
5 if (typeof ret === 'boolean' || !ret) return;
6
7 if (typeof ret.stdout === 'string') {
8 process.stdout.write(ret.stdout);
9 } else {
10 process.stdout.write(ret);
11 }
12};

Callers 1

shxFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…