mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
![]() ### Motivation Add `spec.raise_subproc_error` to have an ability to use `SpecModifierAlias` to manage the errors. Also this is the first step to #4351. Generally in scripts it's good to have RAISE_SUBPROC_ERROR=True to avoid processing the error for every executed command. But in some cases (e.g. `![]`) it's needed to avoid raising the error. To more elegant doing this we can make an ability to create SpecModifier. ### After ```xsh from xonsh.procs.specs import SpecModifierAlias class SpecModifierNoErrAlias(SpecModifierAlias): def on_modifer_added(self, spec): spec.raise_subproc_error = False aliases['noraise'] = SpecModifierNoErrAlias() $RAISE_SUBPROC_ERROR = True if ![noraise git pull]: git add --all ``` Cc #5443 ## For community ⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍 comment** --------- Co-authored-by: a <1@1.1> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> |
||
---|---|---|
.. | ||
__init__.py | ||
test_specs.py |