Skip to content

Update exec async doc - #185

Closed
vise890 wants to merge 1 commit into
shelljs:masterfrom
vise890:update-exec-async-doc
Closed

Update exec async doc#185
vise890 wants to merge 1 commit into
shelljs:masterfrom
vise890:update-exec-async-doc

Conversation

@vise890

@vise890 vise890 commented Feb 2, 2015

Copy link
Copy Markdown
Contributor

The exec docs specify:

exec(command [, options] [, callback])
Available options (all false by default):
async: Asynchronous execution. Defaults to true if a callback is provided.
silent: Do not echo program output to console.

That seems to imply to me that the following code can be written:

exec("sleep 0.5", {async: false}, function() {
    echo("print first");
});
echo("print last");

which prints:

print last
print first

After looking at the code, however, it is clear that options.async is overridden to true if a callback is provided. This PR updates the README to be more in line with the code. What do you think?

@vise890 vise890 mentioned this pull request Feb 4, 2015
@nfischer

Copy link
Copy Markdown
Member

@vise890 This looks good! Could you make the change instead in the comment section and use generate-docs?

@vise890

vise890 commented Jan 14, 2016

Copy link
Copy Markdown
Contributor Author

@nfischer Implemented in #289, closing

@vise890 vise890 closed this Jan 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants