summaryrefslogtreecommitdiff
path: root/cli/tools/upgrade.rs
diff options
context:
space:
mode:
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(