From 8e859f1fe7ba0e644ef8600cb6bf328ac1b7bcb0 Mon Sep 17 00:00:00 2001 From: Joshix Date: Mon, 20 Nov 2023 19:00:00 +0000 Subject: [PATCH] add guide for xonsh --- book/src/guides/README.md | 1 + book/src/guides/xonsh.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 book/src/guides/xonsh.md diff --git a/book/src/guides/README.md b/book/src/guides/README.md index 2b91af9..372f959 100644 --- a/book/src/guides/README.md +++ b/book/src/guides/README.md @@ -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) diff --git a/book/src/guides/xonsh.md b/book/src/guides/xonsh.md new file mode 100644 index 0000000..f33d54b --- /dev/null +++ b/book/src/guides/xonsh.md @@ -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:]] +```