Skip to content

Commit

Permalink
feat: support DEVTOOLS env to open devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
lgou2w committed Sep 20, 2023
1 parent 2208872 commit ee6ece8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
shadow-rs = "0.23.0"
sqlx-core = "0.7.1"
tauri = { version = "1.4.1", features = ["clipboard-all", "dialog-all", "path-all", "process-all", "shell-all"] }
tauri = { version = "1.4.1", features = ["clipboard-all", "dialog-all", "path-all", "process-all", "shell-all", "devtools"] }
thiserror = "1.0.48"
time = { version = "0.3.28", features = ["formatting", "serde", "macros", "serde-human-readable", "local-offset"] }
tokio = { version = "1.32.0", features = ["full"] }
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ fn main() {
.plugin(storage::StoragePluginBuilder::new().build())
.plugin(gacha::GachaPluginBuilder::new().build())
.setup(|app| {
#[cfg(debug_assertions)]
{
let open_devtools = cfg!(debug_assertions) || std::env::var("DEVTOOLS").is_ok();
if open_devtools {
use tauri::Manager;
app.get_window("main").unwrap().open_devtools();
}
Expand Down

0 comments on commit ee6ece8

Please sign in to comment.