Skip to content

update exec docs to match implemented behaviour#289

Merged
nfischer merged 1 commit intoshelljs:masterfrom
vise890:master
Jan 14, 2016
Merged

update exec docs to match implemented behaviour#289
nfischer merged 1 commit intoshelljs:masterfrom
vise890:master

Conversation

@vise890
Copy link
Copy Markdown
Contributor

@vise890 vise890 commented Jan 14, 2016

Re-implementation of #185 (I didn't have the old fork anymore)

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 Jan 14, 2016
@ariporad
Copy link
Copy Markdown
Contributor

LGTM! @nfisher: feel free to merge

nfischer added a commit that referenced this pull request Jan 14, 2016
update `exec` docs to match implemented behaviour
@nfischer nfischer merged commit 439a0b0 into shelljs:master 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.

3 participants