Skip to content

Commit

Permalink
feat: start adding interface to override (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
SobhanMP authored Aug 30, 2024
1 parent 41d3f37 commit 8a9fed3
Show file tree
Hide file tree
Showing 11 changed files with 535 additions and 77 deletions.
18 changes: 10 additions & 8 deletions crates/rattler-bin/src/commands/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,16 @@ pub async fn create(opt: Opt) -> anyhow::Result<()> {
})
.collect::<anyhow::Result<Vec<_>>>()?)
} else {
rattler_virtual_packages::VirtualPackage::current()
.map(|vpkgs| {
vpkgs
.iter()
.map(|vpkg| GenericVirtualPackage::from(vpkg.clone()))
.collect::<Vec<_>>()
})
.map_err(anyhow::Error::from)
rattler_virtual_packages::VirtualPackage::detect(
&rattler_virtual_packages::VirtualPackageOverrides::default(),
)
.map(|vpkgs| {
vpkgs
.iter()
.map(|vpkg| GenericVirtualPackage::from(vpkg.clone()))
.collect::<Vec<_>>()
})
.map_err(anyhow::Error::from)
}
})?;

Expand Down
2 changes: 1 addition & 1 deletion crates/rattler-bin/src/commands/virtual_packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rattler_conda_types::GenericVirtualPackage;
pub struct Opt {}

pub fn virtual_packages(_opt: Opt) -> anyhow::Result<()> {
let virtual_packages = rattler_virtual_packages::VirtualPackage::current()?;
let virtual_packages = rattler_virtual_packages::VirtualPackage::detect(&Default::default())?;
for package in virtual_packages {
println!("{}", GenericVirtualPackage::from(package.clone()));
}
Expand Down
Loading

0 comments on commit 8a9fed3

Please sign in to comment.