这是indexloc提供的服务,不要输入任何密码
Skip to content
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
9 changes: 8 additions & 1 deletion crates/turborepo-lib/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use turborepo_telemetry::{
},
init_telemetry, track_usage, TelemetryHandle,
};
use turborepo_ui::UI;
use turborepo_ui::{GREY, UI};

use crate::{
cli::error::print_potential_tasks,
Expand Down Expand Up @@ -991,6 +991,13 @@ pub async fn run(
}
}

let should_print_version = env::var("TURBO_PRINT_VERSION_DISABLED")
.map_or(true, |disable| !matches!(disable.as_str(), "1" | "true"));

if should_print_version {
eprintln!("{}\n", GREY.apply_to(format!("turbo {}", get_version())));
}

// If there is no command, we set the command to `Command::Run` with
// `self.parsed_args.run_args` as arguments.
let mut command = if let Some(command) = mem::take(&mut cli_args.command) {
Expand Down
1 change: 1 addition & 0 deletions turborepo-tests/helpers/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ fi
export TURBO_TELEMETRY_MESSAGE_DISABLED=1
export TURBO_GLOBAL_WARNING_DISABLED=1
export TURBO_DOWNLOAD_LOCAL_ENABLED=0
export TURBO_PRINT_VERSION_DISABLED=1
TURBO=${MONOREPO_ROOT_DIR}/target/debug/turbo${EXT}
1 change: 1 addition & 0 deletions turborepo-tests/helpers/setup_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ fi

export TURBO_TELEMETRY_MESSAGE_DISABLED=1
export TURBO_GLOBAL_WARNING_DISABLED=1
export TURBO_PRINT_VERSION_DISABLED=1
export TURBO=${MONOREPO_ROOT_DIR}/target/debug/turbo${EXT}

# Undo the set -eo pipefail at the top of this script
Expand Down