mirror of
https://github.com/priyanshujain/margin-calendar.git
synced 2026-10-02 11:07:04 +00:00
announce updates rather than install them when a package manager owns the binary
This commit is contained in:
1 parent
ae5a7b4c0e
commit
958931f5ef
4 files changed
+79
-1
No files matched your search
+12
-1
@@ -233,6 +233,16 @@ fn show_main_window(app: &tauri::AppHandle) {
|
||||
}
|
||||
}
|
||||
|
||||
/// The package manager that owns this install, when one does. The Nix wrapper sets it to "nix":
|
||||
/// the binary lives in a read-only store there, so the updater may announce a version but not
|
||||
/// install it.
|
||||
#[tauri::command]
|
||||
fn packaged_by() -> Option<String> {
|
||||
std::env::var("MARGIN_CALENDAR_PACKAGED_BY")
|
||||
.ok()
|
||||
.filter(|manager| !manager.is_empty())
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
// generate_context! first, so the updater plugin registers only when the merged config
|
||||
@@ -323,7 +333,8 @@ pub fn run() {
|
||||
sync::event_delete,
|
||||
sync::sync_now,
|
||||
sync::sync_status,
|
||||
sync::sync_flush
|
||||
sync::sync_flush,
|
||||
packaged_by
|
||||
])
|
||||
.build(context)
|
||||
.expect("error while building Margin Calendar");
|
||||
|
||||
Reference in new issue
Block a user