Skip to content
Open
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
20 changes: 9 additions & 11 deletions cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,19 +672,13 @@ async fn resolve_flags_and_init(
.map(|files| files.iter().map(PathBuf::from).collect());
load_env_variables_from_env_files(env_file_paths.as_ref(), flags.log_level);

if deno_lib::args::has_flag_env_var("DENO_CONNECTED")
&& matches!(
flags.subcommand,
DenoSubcommand::Run { .. }
| DenoSubcommand::Serve { .. }
| DenoSubcommand::Task { .. }
)
{
if deno_lib::args::has_flag_env_var("DENO_CONNECTED") {
flags.tunnel = true;
}

// Tunnel sets up env vars and OTEL, so connect before everything else.
if flags.tunnel {
if flags.tunnel && !matches!(flags.subcommand, DenoSubcommand::Deploy { .. })
{
if let Err(err) = initialize_tunnel(&flags).await {
exit_for_error(err.context("Failed to start with tunnel"));
}
Expand Down Expand Up @@ -1056,7 +1050,9 @@ async fn initialize_tunnel(
format!("https://{}:{}", addr.hostname(), addr.port())
};

log::info!(
// We explicitly use eprintln instead of log here since
// there is a circular dep between tunnel and telemetry
eprintln!(
"{}",
colors::green(format!("You are connected to {endpoint}"))
);
Expand All @@ -1067,7 +1063,9 @@ async fn initialize_tunnel(
} else {
"".into()
};
log::info!(
// We explicitly use eprintln instead of log here since
// there is a circular dep between tunnel and telemetry
eprintln!(
"{}",
colors::green(format!(
"Reconnecting tunnel in {}s...{}",
Expand Down
Loading