mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-13 11:50:36 +00:00
fix: 🐛 correctly enable fields with features
This commit is contained in:
parent
e999f65ce9
commit
ba6c218847
2 changed files with 22 additions and 15 deletions
|
@ -3,7 +3,6 @@ use chrono::Utc;
|
||||||
use std::{
|
use std::{
|
||||||
collections::{BTreeMap, HashMap},
|
collections::{BTreeMap, HashMap},
|
||||||
fs::{create_dir_all, read, remove_dir_all, write, File},
|
fs::{create_dir_all, read, remove_dir_all, write, File},
|
||||||
process::Command as SysCommand,
|
|
||||||
str::FromStr,
|
str::FromStr,
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
@ -115,17 +114,20 @@ pub fn root_command(cmd: Command) -> anyhow::Result<()> {
|
||||||
"Downloading packages".to_string(),
|
"Downloading packages".to_string(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
project.convert_manifests(&resolved_versions_map, |path| {
|
project.convert_manifests(&resolved_versions_map, |path| {
|
||||||
|
cfg_if! {
|
||||||
|
if #[cfg(feature = "wally")] {
|
||||||
if let Some(sourcemap_generator) = &manifest.sourcemap_generator {
|
if let Some(sourcemap_generator) = &manifest.sourcemap_generator {
|
||||||
cfg_if! {
|
cfg_if! {
|
||||||
if #[cfg(target_os = "windows")] {
|
if #[cfg(target_os = "windows")] {
|
||||||
SysCommand::new("pwsh")
|
std::process::Command::new("pwsh")
|
||||||
.args(["-C", &sourcemap_generator])
|
.args(["-C", &sourcemap_generator])
|
||||||
.current_dir(path)
|
.current_dir(path)
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to execute process");
|
.expect("failed to execute process");
|
||||||
} else {
|
} else {
|
||||||
SysCommand::new("sh")
|
std::process::Command::new("sh")
|
||||||
.args(["-c", &sourcemap_generator])
|
.args(["-c", &sourcemap_generator])
|
||||||
.current_dir(path)
|
.current_dir(path)
|
||||||
.output()
|
.output()
|
||||||
|
@ -133,6 +135,8 @@ pub fn root_command(cmd: Command) -> anyhow::Result<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let project = Lazy::force_mut(&mut project);
|
let project = Lazy::force_mut(&mut project);
|
||||||
|
@ -414,6 +418,7 @@ pub fn root_command(cmd: Command) -> anyhow::Result<()> {
|
||||||
DEFAULT_INDEX_NAME.to_string(),
|
DEFAULT_INDEX_NAME.to_string(),
|
||||||
DEFAULT_INDEX_URL.to_string(),
|
DEFAULT_INDEX_URL.to_string(),
|
||||||
)]),
|
)]),
|
||||||
|
#[cfg(feature = "wally")]
|
||||||
sourcemap_generator: None,
|
sourcemap_generator: None,
|
||||||
|
|
||||||
dependencies: Default::default(),
|
dependencies: Default::default(),
|
||||||
|
|
|
@ -41,6 +41,7 @@ fn test_resolves_package() {
|
||||||
private: true,
|
private: true,
|
||||||
realm: None,
|
realm: None,
|
||||||
indices: Default::default(),
|
indices: Default::default(),
|
||||||
|
#[cfg(feature = "wally")]
|
||||||
sourcemap_generator: None,
|
sourcemap_generator: None,
|
||||||
|
|
||||||
dependencies: vec![],
|
dependencies: vec![],
|
||||||
|
@ -80,6 +81,7 @@ fn test_resolves_package() {
|
||||||
private: true,
|
private: true,
|
||||||
realm: None,
|
realm: None,
|
||||||
indices: Default::default(),
|
indices: Default::default(),
|
||||||
|
#[cfg(feature = "wally")]
|
||||||
sourcemap_generator: None,
|
sourcemap_generator: None,
|
||||||
|
|
||||||
dependencies: vec![specifier.clone()],
|
dependencies: vec![specifier.clone()],
|
||||||
|
|
Loading…
Reference in a new issue