[WIP] exec async bug? - #182
Conversation
|
I saw your changes and I think you don't need to change any logic there, if you just change the default value of async: Then it will only be true if there's a callback specified I believe this is what was intended, but it has a typo on the initialisation of the async property. |
|
@thegiantbeast I don't think that your first change would be beneficial. Then every time you provide just a callback, it will be run syncronously. Which is not what the docs imply. If you provide options like |
|
ok so I started from scratch an made a new PR in #184 |
|
@vise890 I think you should review your logic, your latest change wouldn't work either. You won't be able to set async as false as I checked the code again and the logic is right (ignore my previous comment about the typo). What are you trying to achieve? |
|
You're right in pointing out that my logic is wrong. What I'm trying to achieve is that when you pass If that's not possible then you shouldn't say that options.async is Here's the specific point in the docs I'm referring to BTW: I'll have another look tomorrow. @vise890 https://github.com/vise890 I think you should review your logic, options.async = options.async || true; You won't be able to set async as false as false || true will always return I checked the code again and the logic is right (ignore my previous comment What are you trying to achieve? — |
|
I think you misunderstood what is said (maybe it needs some clarification), but the documentation what's trying to say is that in case of a callback you don't need to see async as it's set automatically for you. And the option is there for the case where you don't have/need a callback but you still want to run the command asynchronously, ie But the feature is correct and the documentation is also "correct", but maybe it should clarify a little bit better. |
|
Ok have you had a look at #185 ? I think the docs aren't very clear when they state:
To me, saying that it "defaults" to |
|
Yes, I understand what you're saying and that's why I said documentation needs some clarification (maybe replace default with:
I think this will explain correctly the functionality of it. |
Hi there,
Say, I ran this code:
...as output, I will get:
Your documentation on shelljs.org seems to imply that if you pass in an
{async:false}as options, you still get to run code synchronously. Am I misreading the docs?I think you are overwriting
options.asyncin here: https://github.com/vise890/shelljs/compare/arturadib:master...vise890:master#diff-c3bfabb5e6987aa21bc75ffd95a162d6L168Check out the diff, tell me what you think. Cheers. M.