mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 11:00:36 +00:00
fix: link dependencies in x command
This commit is contained in:
parent
b5b3257cac
commit
97cc58afcf
1 changed files with 28 additions and 5 deletions
|
@ -5,7 +5,7 @@ use fs_err::tokio as fs;
|
|||
use indicatif::MultiProgress;
|
||||
use pesde::{
|
||||
linking::generator::generate_bin_linking_module,
|
||||
manifest::target::TargetKind,
|
||||
manifest::{target::TargetKind, DependencyType},
|
||||
names::PackageName,
|
||||
source::{
|
||||
pesde::{specifier::PesdeDependencySpecifier, PesdePackageSource},
|
||||
|
@ -14,7 +14,9 @@ use pesde::{
|
|||
Project,
|
||||
};
|
||||
use semver::VersionReq;
|
||||
use std::{collections::HashSet, env::current_dir, ffi::OsString, io::Write, process::Command};
|
||||
use std::{
|
||||
collections::HashSet, env::current_dir, ffi::OsString, io::Write, process::Command, sync::Arc,
|
||||
};
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
pub struct ExecuteCommand {
|
||||
|
@ -115,11 +117,10 @@ impl ExecuteCommand {
|
|||
.await
|
||||
.context("failed to build dependency graph")?;
|
||||
|
||||
let rx = project
|
||||
let (rx, downloaded_graph) = project
|
||||
.download_graph(&graph, &mut refreshed_sources, &reqwest, true, true)
|
||||
.await
|
||||
.context("failed to download dependencies")?
|
||||
.0;
|
||||
.context("failed to download dependencies")?;
|
||||
|
||||
progress_bar(
|
||||
graph.values().map(|versions| versions.len() as u64).sum(),
|
||||
|
@ -131,6 +132,28 @@ impl ExecuteCommand {
|
|||
)
|
||||
.await?;
|
||||
|
||||
let downloaded_graph = Arc::into_inner(downloaded_graph)
|
||||
.unwrap()
|
||||
.into_inner()
|
||||
.unwrap();
|
||||
|
||||
project
|
||||
.link_dependencies(
|
||||
&downloaded_graph
|
||||
.into_iter()
|
||||
.map(|(n, v)| {
|
||||
(
|
||||
n,
|
||||
v.into_iter()
|
||||
.filter(|(_, n)| n.node.resolved_ty != DependencyType::Dev)
|
||||
.collect(),
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
)
|
||||
.await
|
||||
.context("failed to link dependencies")?;
|
||||
|
||||
let mut caller =
|
||||
tempfile::NamedTempFile::new_in(tempdir.path()).context("failed to create tempfile")?;
|
||||
caller
|
||||
|
|
Loading…
Reference in a new issue