summaryrefslogtreecommitdiff
path: root/cli/tools/upgrade.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-11-17 22:46:15 -0500
committerGitHub <noreply@github.com>2023-11-17 22:46:15 -0500
commitc213ad380f349dee1f65e6d9a9f7a8fa669b2af2 (patch)
tree9265e433c2691bf39c699617b87f755c1d025908 /cli/tools/upgrade.rs
parent4a2d8c4bbd20cc282b4df42fe5da6414447315e0 (diff)
chore: combine `TestCommandBuilder` with `DenoCmd` (#21248)
Diffstat (limited to 'cli/tools/upgrade.rs')
-rw-r--r--cli/tools/upgrade.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/tools/upgrade.rs b/cli/tools/upgrade.rs
index cd886fbd7..c5efa771b 100644
--- a/cli/tools/upgrade.rs
+++ b/cli/tools/upgrade.rs
@@ -593,7 +593,16 @@ fn get_url(
UpgradeCheckKind::Execution => "",
UpgradeCheckKind::Lsp => "?lsp",
};
- format!("https://dl.deno.land/{}{}", file_name, query_param)
+ format!("{}/{}{}", base_upgrade_url(), file_name, query_param)
+}
+
+fn base_upgrade_url() -> Cow<'static, str> {
+ // this is used to get the current version
+ if let Ok(url) = env::var("DENO_DONT_USE_INTERNAL_BASE_UPGRADE_URL") {
+ Cow::Owned(url)
+ } else {
+ Cow::Borrowed("https://dl.deno.land")
+ }
}
async fn download_package(