Skip to content

Bash-friendly way to query cargo metadata (package version) #33

@kornelski

Description

@kornelski

Related to #8

I package my apps with a bash script sort of like this:

cargo build --release
tar cjf app-$VERSION.tar.gz target/release/app
rsync etc.

The problematic part is $VERSION. I would like to read the version from Cargo.toml, but can't without string manipulation in bash (yuck!)

I'd be great if there was something like cargo metadata --query package.version that outputs nothing by the given Cargo.toml key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-distributionArea: Licensing, packaging, etc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions