mirror of
https://github.com/pesde-pkg/pesde.git
synced 2025-05-04 10:33:47 +01:00
Merge branch 'dev-only' of https://github.com/Stefanuk12/pesde into dev-only
This commit is contained in:
commit
c0a2f24fde
1 changed files with 3 additions and 5 deletions
|
@ -66,10 +66,9 @@ impl DownloadAndLinkHooks for () {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Options for which dependencies to install.
|
/// Options for which dependencies to install.
|
||||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum InstallDependenciesMode {
|
pub enum InstallDependenciesMode {
|
||||||
/// Install all dependencies.
|
/// Install all dependencies.
|
||||||
#[default]
|
|
||||||
All,
|
All,
|
||||||
/// Install only dependencies, not dev_dependencies.
|
/// Install only dependencies, not dev_dependencies.
|
||||||
Prod,
|
Prod,
|
||||||
|
@ -279,8 +278,8 @@ impl Project {
|
||||||
return Some(make_fut(id, node, container_folder));
|
return Some(make_fut(id, node, container_folder));
|
||||||
}
|
}
|
||||||
|
|
||||||
// not a direct dependency, check if it's parent is and matches the install mode
|
// not a direct dependency, check if its parent is and matches the install mode
|
||||||
// todo: optimise this maybe. many iterations through graph can add up if graph big
|
// TODO: optimise this maybe. many iterations through the graph can add up if the graph's big
|
||||||
|
|
||||||
let mut current_parent = &id;
|
let mut current_parent = &id;
|
||||||
while let Some((parent_id, parent_node)) =
|
while let Some((parent_id, parent_node)) =
|
||||||
|
@ -479,7 +478,6 @@ impl Project {
|
||||||
.map_err(errors::DownloadAndLinkError::Hook)?;
|
.map_err(errors::DownloadAndLinkError::Hook)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let graph = Arc::into_inner(graph).unwrap();
|
|
||||||
|
|
||||||
if install_dependencies_mode != InstallDependenciesMode::All || !force {
|
if install_dependencies_mode != InstallDependenciesMode::All || !force {
|
||||||
self.remove_unused(&graph).await?;
|
self.remove_unused(&graph).await?;
|
||||||
|
|
Loading…
Add table
Reference in a new issue