Gankra / cargo-mommy

Mommy's here to support you when running cargo~
https://faultlore.com/cargo-mommy/
Apache License 2.0
726 stars 49 forks source link

mommy can be run every time you run cargo~ #77

Open jyn514 opened 7 months ago

jyn514 commented 7 months ago

i promised ages ago to document this and then i never did lmao

here is a dump of my ~/.profile, which makes e.g. cargo build act as if you'd run cargo mommy build

# mommy loves you~
cargo() {
    case "$1" in
    +*) toolchain=$1
        shift
        command cargo "$toolchain" mommy "$@"
        ;;
    *) command cargo mommy "$@";;
    esac
}
jyn514 commented 7 months ago

you can also configure your prompt to run mommy so you can get feedback even if you're not running cargo~

PS1='$(if [ $? = 0 ]; then CARGO=true cargo-mommy; else CARGO=false cargo-mommy; fi)'"$PS1"

but don't do both unless you want to get double the feedback from mommy!