Merge branch 'master' into add_license

This commit is contained in:
lucas lelievre authored and GitHub committed 2022-04-24 14:03:57 +02:00
commit 5fae72fb03
11 files changed
+6291 -6931

No files matched your search

+4 -4
View File
@@ -1,6 +1,6 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
# JS/TS dependencies
/node_modules
/.pnp
.pnp.js
@@ -8,8 +8,9 @@
# testing
/coverage
# production
# Build artifacts
/build
/target
# misc
.DS_Store
@@ -22,5 +23,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.log
*.log
Generated
+4117
View File
File diff suppressed because it is too large. Load diff
+3
View File
@@ -0,0 +1,3 @@
[workspace]
resolver = "2"
members = ["src-tauri"]
+2110 -6891
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -22,7 +22,7 @@
"react-modal": "^3.14.4",
"react-router-dom": "^6.2.2",
"react-scripts": "5.0.0",
"slimevr-protocol": "file:../SlimeVR-Server/soloarxr-protocol",
"slimevr-protocol": "file:../SolarXR-Protocol",
"typescript": "^4.6.3",
"web-vitals": "^2.1.4"
},
View File
Whitespace-only changes.
+11
View File
@@ -61,6 +61,7 @@ dependencies = [
"serde_json",
"tauri",
"tauri-build",
"win32job",
]
[[package]]
@@ -3640,6 +3641,16 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6c48bd20df7e4ced539c12f570f937c6b4884928a87fee70a479d72f031d4e0"
[[package]]
name = "win32job"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b2a14136f6c8be9146ac6345774ab32cb93e7985319b4a1b42abb663bd64235"
dependencies = [
"thiserror",
"winapi",
]
[[package]]
name = "winapi"
version = "0.3.9"
+6 -4
View File
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
repository = ""
default-run = "app"
edition = "2021"
rust-version = "1.57"
rust-version = "1.59"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -14,9 +14,11 @@ rust-version = "1.57"
tauri-build = { version = "1.0.0-rc.5", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0-rc.5", features = ["api-all"] }
serde_json = "1"
serde = { version = "1", features = ["derive"] }
tauri = { version = "1.0.0-rc.6", features = ["api-all"] }
pretty_env_logger = "0.4"
log = "0.4"
[features]
# by default Tauri runs in production mode
+1 -1
View File
@@ -1,3 +1,3 @@
fn main() {
tauri_build::build()
tauri_build::build()
}
+37 -29
View File
@@ -1,42 +1,50 @@
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
use std::path::PathBuf;
use std::process::Command;
use std::path::Path;
// the payload type must implement `Serialize` and `Clone`.
fn main() {
// Set up loggers and global handlers
{
if std::env::var_os("RUST_LOG").is_none() {
std::env::set_var("RUST_LOG", "info")
}
pretty_env_logger::init();
}
let child = if Path::new("run.bat").exists() {
let child = Command::new("cmd")
.args(["/C", "run.bat"])
.spawn()
.expect("sh command failed to start");
Some(child)
} else {
println!("No run.bat found, SKIP");
None
};
// Ensure child processes die when spawned on windows
#[cfg(target_os = "windows")]
{
use win32job::{ExtendedLimitInfo, Job};
tauri::Builder::default()
.on_window_event(|event| match event.event() {
tauri::WindowEvent::Destroyed => {
println!("DESTROYED");
let mut info = ExtendedLimitInfo::new();
info.limit_kill_on_job_close();
let job = Job::create_with_limit_info(&mut info).expect("Failed to create Job");
job.assign_current_process()
.expect("Failed to assign current process to Job");
}
_ => {}
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
// We don't do anything with the job anymore, but we shouldn't drop it because that would
// terminate our process tree. So we intentionally leak it instead.
std::mem::forget(job);
}
child.map(|mut child| {
child.wait().unwrap();
println!("STOP?");
});
// Spawn server process
let runfile_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("run.bat");
if runfile_path.exists() {
Command::new("cmd")
.args(["/C", runfile_path.to_str().unwrap()])
.spawn()
.expect("sh command failed to start");
} else {
log::warn!("No run.bat found, SKIP");
}
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
+1 -1
View File
@@ -64,4 +64,4 @@
"csp": null
}
}
}
}