Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add guide for xonsh #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions book/src/guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ These guides are intended to help folks setup cargo-mommy in situations like the

* [persistent bash config](./bash.md)
* [persistent powershell config](./powershell.md)
* [persistent xonsh config](./xonsh.md)
* [ci scripting](./ci.md)
* the rust build system (x.py)
* using cargo-mommy for other non-cargo-mommy commands (CARGO_MOMMYS_ACTUAL)
Expand Down
14 changes: 14 additions & 0 deletions book/src/guides/xonsh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# xonsh

if you want to have mommy help you with cargo, git and rustup
you can put the following in ~/.xonshrc

```py
@events.on_pre_spec_run_cargo
@events.on_pre_spec_run_git
@events.on_pre_spec_run_rustup
def cargo_mommy(spec=None, **kwargs):
spec.env = dict(spec.env or {})
spec.env["CARGO_MOMMYS_ACTUAL"] = spec.cmd[0]
spec.cmd = ["cargo-mommy", *spec.cmd[1:]]
```