Add in translation for && and || as follows:
$ true && echo 'hi'
hi
$ false || echo 'hi'
hi
In general, it may be tough to get this working as nicely as possible. commands like test -f file.txt return booleans, and it would be nice to take advantage of that in translation, while other commands like exec('git status') have .code attributes that should be examined instead.
Also, this should work with other formats, such as [ "my string" ] && echo hi.
It'd be really great if better support for && and || could be worked into n_shell or ShellJS proper.
Add in translation for
&&and||as follows:In general, it may be tough to get this working as nicely as possible. commands like
test -f file.txtreturn booleans, and it would be nice to take advantage of that in translation, while other commands likeexec('git status')have.codeattributes that should be examined instead.Also, this should work with other formats, such as
[ "my string" ] && echo hi.It'd be really great if better support for
&&and||could be worked into n_shell or ShellJS proper.