diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rs index 56f94f526f..c8f70b1688 100644 --- a/crates/auto_update/src/auto_update.rs +++ b/crates/auto_update/src/auto_update.rs @@ -70,6 +70,12 @@ pub fn init(http_client: Arc, server_url: String, cx: &mut Mutab } } +pub fn check(cx: &mut MutableAppContext) { + if let Some(updater) = AutoUpdater::get(cx) { + updater.update(cx, |updater, cx| updater.poll(cx)); + } +} + impl AutoUpdater { fn get(cx: &mut MutableAppContext) -> Option> { cx.default_global::>>().clone() diff --git a/crates/zed/src/menus.rs b/crates/zed/src/menus.rs index 33ac76e63c..8d23dc4f58 100644 --- a/crates/zed/src/menus.rs +++ b/crates/zed/src/menus.rs @@ -13,6 +13,11 @@ pub fn menus(state: &Arc) -> Vec> { keystroke: None, action: Box::new(super::About), }, + MenuItem::Action { + name: "Check for Updates", + keystroke: None, + action: Box::new(super::CheckForUpdates), + }, MenuItem::Separator, MenuItem::Action { name: "Quit", diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index 7968f23466..479e65dba0 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -31,6 +31,7 @@ action!(About); action!(Quit); action!(OpenSettings); action!(AdjustBufferFontSize, f32); +action!(CheckForUpdates); const MIN_FONT_SIZE: f32 = 6.0; @@ -43,6 +44,7 @@ lazy_static! { pub fn init(app_state: &Arc, cx: &mut gpui::MutableAppContext) { cx.add_global_action(quit); + cx.add_global_action(|_: &CheckForUpdates, cx| auto_update::check(cx)); cx.add_global_action({ move |action: &AdjustBufferFontSize, cx| { cx.update_global::(|settings, cx| {