Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add support for --skip-infer #3022

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cli/integration_tests/global_turbo/uses_global.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Setup
$ . ${TESTDIR}/../setup.sh

When --skip-infer is used we use the current binary and output no global/local message
$ ${TURBO} --skip-infer --help | head -n 1
The build system that makes ship happen
1 change: 1 addition & 0 deletions cli/integration_tests/no_args.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Make sure exit code is 2 when no args are passed

Options:
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down
6 changes: 6 additions & 0 deletions cli/integration_tests/turbo_help.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Test help flag

Options:
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down Expand Up @@ -84,6 +85,7 @@ Test help flag

Options:
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down Expand Up @@ -132,6 +134,7 @@ Test help flag for link command
Options:
--no-gitignore Do not create or modify .gitignore (default false)
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down Expand Up @@ -159,6 +162,7 @@ Test help flag for unlink command

Options:
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down Expand Up @@ -187,6 +191,7 @@ Test help flag for login command
Options:
--sso-team <SSO_TEAM>
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down Expand Up @@ -214,6 +219,7 @@ Test help flag for logout command

Options:
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down
5 changes: 5 additions & 0 deletions crates/turborepo-lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ pub enum DryRunMode {
pub struct Args {
#[clap(long, global = true)]
pub version: bool,
#[clap(long, global = true)]
#[serde(skip)]
/// Skip any attempts to infer which version of Turbo the project is
/// configured to use
pub skip_infer: bool,
/// Override the endpoint for API calls
#[clap(long, global = true, value_parser)]
pub api: Option<String>,
Expand Down