Skip to content

cargo don't immediately available in bash script  #3684

@q2333gh

Description

@q2333gh

Problem you are trying to solve

#!/bin/bash
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
cargo check

running the script says: sh: 3: cargo: not found
Although we can mannually cun source "$HOME/.cargo/env" i will work.
but its not good for script automation . such as set up a new dev machine require as a single script.

Solution you'd like

by exec curl https://sh.rustup.rs -sSf | sh -s -- -y and source "$HOME/.cargo/env" inside script
cargo should work inside a bash script session.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions