Skip to content

Commit

Permalink
Merge pull request #5 from transcental/main
Browse files Browse the repository at this point in the history
fix not restarting after update
  • Loading branch information
transcental authored Nov 17, 2024
2 parents b1e1347 + de9fcc9 commit ddd4ede
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 11 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-dialog": "~2",
"@tauri-apps/plugin-process": "~2",
"@tauri-apps/plugin-shell": "^2",
"@tauri-apps/plugin-updater": "~2"
},
Expand Down
11 changes: 11 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ tauri-plugin-shell = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-plugin-dialog = "2"
tauri-plugin-process = "2"

[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-updater = "2"
Expand Down
18 changes: 12 additions & 6 deletions src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": ["core:default", "shell:allow-open", "dialog:default",
"dialog:allow-ask",
"dialog:allow-message",
"updater:default",
"updater:allow-check",
"updater:allow-download-and-install" ]
"permissions": [
"core:default",
"shell:allow-open",
"dialog:default",
"dialog:allow-ask",
"dialog:allow-message",
"updater:default",
"updater:allow-check",
"updater:allow-download-and-install",
"process:allow-restart",
"process:default"
]
}
1 change: 1 addition & 0 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mod commands;
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_shell::init())
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "quilter",
"version": "0.1.2",
"version": "0.1.3",
"identifier": "dev.transcental.quilter",
"build": {
"beforeDevCommand": "bun run dev",
Expand Down
6 changes: 2 additions & 4 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { invoke } from "@tauri-apps/api/core";
import { ask, message } from "@tauri-apps/plugin-dialog";
import { check } from "@tauri-apps/plugin-updater";
import { relaunch } from "@tauri-apps/plugin-process";
async function checkForAppUpdates(userAsked: boolean = false) {
const update = await check();
Expand All @@ -25,10 +26,7 @@
);
if (yes) {
await update.downloadAndInstall();
// Restart the app after the update is installed by calling the Tauri command that handles restart for your app
// It is good practice to shut down any background processes gracefully before restarting
// As an alternative, you could ask the user to restart the app manually
await invoke("graceful_restart");
await relaunch();
}
}
}
Expand Down

0 comments on commit ddd4ede

Please sign in to comment.