Skip to content

Commit

Permalink
Make single_package optional and only overwrite if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Soltis authored and Greg Soltis committed Jun 22, 2023
1 parent 8d31274 commit fb05f8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions crates/turborepo-lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ pub struct RunArgs {
pub dry_run: Option<DryRunMode>,
/// Run turbo in single-package mode
#[clap(long, global = true)]
pub single_package: bool,
pub single_package: Option<bool>,
/// Use the given selector to specify package(s) to act as
/// entry points. The syntax mirrors pnpm's syntax, and
/// additional documentation and examples can be found in
Expand Down Expand Up @@ -640,7 +640,11 @@ pub async fn run(
if let Some(pkg_inference_root) = pkg_inference_root {
run_args.pkg_inference_root = Some(pkg_inference_root);
}
run_args.single_package = matches!(repo_state.mode, RepoMode::SinglePackage);
if run_args.single_package.is_none()
&& matches!(repo_state.mode, RepoMode::SinglePackage)
{
run_args.single_package = Some(true);
}
}
}
cli_args.command = Some(command);
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl<'a> TryFrom<&'a RunArgs> for RunOpts<'a> {
passthrough_args: args.pass_through_args.as_ref(),
only: args.only,
no_daemon: args.no_daemon,
single_package: args.single_package,
single_package: args.single_package.unwrap_or(false),
graph_dot,
graph_file,
dry_run_json: matches!(args.dry_run, Some(DryRunMode::Json)),
Expand Down

0 comments on commit fb05f8b

Please sign in to comment.