mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
feat: Support passing workspace to --manifest-path
(#1246)
Previously it will load the root `Cargo.toml` and treat it as the manifest for the crate, now it will check its `package.name` and would search for the workspace if the `package.name` does not match the crate name. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
b4cf580e4f
commit
aeacebcf83
3 changed files with 43 additions and 30 deletions
|
@ -1,12 +1,14 @@
|
|||
use binstalk::ops::resolve::load_manifest_path;
|
||||
use cargo_toml::Product;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[test]
|
||||
fn parse_meta() {
|
||||
let mut manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
manifest_dir.push_str("/tests/parse-meta.Cargo.toml");
|
||||
let mut manifest_dir = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap());
|
||||
manifest_dir.push("tests/parse-meta.Cargo.toml");
|
||||
|
||||
let manifest = load_manifest_path(&manifest_dir).expect("Error parsing metadata");
|
||||
let manifest =
|
||||
load_manifest_path(&manifest_dir, "cargo-binstall-test").expect("Error parsing metadata");
|
||||
let package = manifest.package.unwrap();
|
||||
let meta = package.metadata.and_then(|m| m.binstall).unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue