Skip to content

Commit c5265c0

Browse files
committed
fix ci
1 parent c33d4cf commit c5265c0

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

crates/vite_install/src/commands/publish.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ impl PackageManager {
214214
&& options.filters.map_or(true, |filters| filters.is_empty())
215215
&& options.publish_branch.is_none()
216216
&& !options.report_summary
217+
&& options
218+
.pass_through_args
219+
.map_or(true, |pass_through_args| pass_through_args.is_empty())
217220
&& !options.force;
218221

219222
if can_use_native_yarn {
@@ -677,6 +680,19 @@ mod tests {
677680
assert_eq!(result.args, vec!["publish", "--force"]);
678681
}
679682

683+
#[test]
684+
fn test_yarn_modern_publish_with_pass_through_args_falls_back_to_npm() {
685+
let pm = create_mock_package_manager(PackageManagerType::Yarn, "4.0.0");
686+
let pass_through_args = vec!["--loglevel".to_string(), "error".to_string()];
687+
let result = pm.resolve_publish_command(&PublishCommandOptions {
688+
dry_run: true,
689+
pass_through_args: Some(&pass_through_args),
690+
..Default::default()
691+
});
692+
assert_eq!(result.bin_path, "npm");
693+
assert_eq!(result.args, vec!["publish", "--dry-run", "--loglevel", "error"]);
694+
}
695+
680696
#[test]
681697
fn test_pnpm_publish_keeps_filter_order_and_global_position() {
682698
let pm = create_mock_package_manager(PackageManagerType::Pnpm, "10.0.0");

0 commit comments

Comments
 (0)