rannn505 / child-shell

Node.js bindings 🔗 for shell
http://rannn505.github.io/child-shell/
MIT License
299 stars 71 forks source link

Documentation: .addArgument() / .addParameter() / .addParameters() calls in sample commands are incorrect #115

Closed mklement0 closed 2 years ago

mklement0 commented 4 years ago

For instance, https://rannn505.gitbook.io/node-powershell/shell/addparameter shows:

// 'Write-Host node-powershell -foregroundcolor red -nonewline'
ps.addCommand('Write-Host node-powershell')
  .then(() => ps.addParameter({foregroundcolor: 'red'}))
  .then(() => ps.addParameter({nonewline: null})) //switch;

The command doesn't actually work unless you remove the .then() => part.

That is, the method calls must be independent statements for argument / parameter passing to work.

This has been reported before, but the issue closed by the reporter him/herself without resolution: #109

rannn505 commented 4 years ago

@mklement0 , please wait for the new version.. its pretty much what you asked for!