Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Equivalent to bash's "&&" #137
Great project! It would be very nice to have a keyword in xonsh that is equivalent to
For completeness' sake there should also be a keyword equivalent to
The current xonsh behavior (v0.1.2) for this syntax seems to be 100% cpu usage and doing nothing until I hit Ctrl+C
I was already thinking whether the standard subprocess mode $[...] shouldn't return the command's exit code by default, however, a naive implementation would cause the exit code to be printed on screen then each time. Also, the "success" code is 0, which means it can't easily be used in standard Python comparisons, which is awkward.
Alternatively, $[...] could return a StatusCode object, which would evaluate to True if the code was 0, False otherwise, and prints as an empty string, though that seems a bit hacky.
However, I also believe that implementing such a behaviour would require quite a few internal changes, because the return code of subprocess commands isn't even currently stored as far as I remember.
Just some food for thought @wrywerytwreywery, because I investigated this for a little while already :)
Hi All, before anyone gets too far down the road on this, I'd like to make a few points:
I'd also like to note that precedence rules come in to play here. Thus the need for grouping with