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 indicatif::MultiProgress;
|
||||||
use pesde::{
|
use pesde::{
|
||||||
linking::generator::generate_bin_linking_module,
|
linking::generator::generate_bin_linking_module,
|
||||||
manifest::target::TargetKind,
|
manifest::{target::TargetKind, DependencyType},
|
||||||
names::PackageName,
|
names::PackageName,
|
||||||
source::{
|
source::{
|
||||||
pesde::{specifier::PesdeDependencySpecifier, PesdePackageSource},
|
pesde::{specifier::PesdeDependencySpecifier, PesdePackageSource},
|
||||||
|
@ -14,7 +14,9 @@ use pesde::{
|
||||||
Project,
|
Project,
|
||||||
};
|
};
|
||||||
use semver::VersionReq;
|
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)]
|
#[derive(Debug, Args)]
|
||||||
pub struct ExecuteCommand {
|
pub struct ExecuteCommand {
|
||||||
|
@ -115,11 +117,10 @@ impl ExecuteCommand {
|
||||||
.await
|
.await
|
||||||
.context("failed to build dependency graph")?;
|
.context("failed to build dependency graph")?;
|
||||||
|
|
||||||
let rx = project
|
let (rx, downloaded_graph) = project
|
||||||
.download_graph(&graph, &mut refreshed_sources, &reqwest, true, true)
|
.download_graph(&graph, &mut refreshed_sources, &reqwest, true, true)
|
||||||
.await
|
.await
|
||||||
.context("failed to download dependencies")?
|
.context("failed to download dependencies")?;
|
||||||
.0;
|
|
||||||
|
|
||||||
progress_bar(
|
progress_bar(
|
||||||
graph.values().map(|versions| versions.len() as u64).sum(),
|
graph.values().map(|versions| versions.len() as u64).sum(),
|
||||||
|
@ -131,6 +132,28 @@ impl ExecuteCommand {
|
||||||
)
|
)
|
||||||
.await?;
|
.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 =
|
let mut caller =
|
||||||
tempfile::NamedTempFile::new_in(tempdir.path()).context("failed to create tempfile")?;
|
tempfile::NamedTempFile::new_in(tempdir.path()).context("failed to create tempfile")?;
|
||||||
caller
|
caller
|
||||||
|
|
Loading…
Reference in a new issue