Merge pull request #109 from Drevoed/chore/bump-deps

chore: bump rust deps
This commit is contained in:
SpikeHD 2022-11-17 20:09:08 -08:00 committed by GitHub
commit 6db219e32e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 750 additions and 782 deletions

1
.gitignore vendored
View File

@ -10,6 +10,7 @@
# production
/build
.idea
# misc
.DS_Store

8
.idea/.gitignore vendored
View File

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src-tauri/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
<excludeFolder url="file://$MODULE_DIR$/src-tauri/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="PROJECT_FILES" />
<option name="description" value="" />
</component>
</project>

View File

@ -1,40 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="HtmlUnknownBooleanAttribute" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HttpUrlsUsage" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredUrls">
<list>
<option value="http://localhost" />
<option value="http://127.0.0.1" />
<option value="http://0.0.0.0" />
<option value="http://www.w3.org/" />
<option value="http://json-schema.org/draft" />
<option value="http://java.sun.com/" />
<option value="http://xmlns.jcp.org/" />
<option value="http://javafx.com/javafx/" />
<option value="http://javafx.com/fxml" />
<option value="http://maven.apache.org/xsd/" />
<option value="http://maven.apache.org/POM/" />
<option value="http://www.springframework.org/schema/" />
<option value="http://www.springframework.org/tags" />
<option value="http://www.springframework.org/security/tags" />
<option value="http://www.thymeleaf.org" />
<option value="http://www.jboss.org/j2ee/schema/" />
<option value="http://www.jboss.com/xml/ns/" />
<option value="http://www.ibm.com/webservices/xsd" />
<option value="http://activemq.apache.org/schema/" />
<option value="http://schema.cloudfoundry.org/spring/" />
<option value="http://schemas.xmlsoap.org/" />
<option value="http://cxf.apache.org/schemas/" />
<option value="http://primefaces.org/ui" />
<option value="http://tiles.apache.org/" />
<option value="http://api.grasscutter.io" />
<option value="http://api.grasscutters.xyz" />
</list>
</option>
</inspection_tool>
<inspection_tool class="JSIgnoredPromiseFromCall" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
</profile>
</component>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/cultivation.iml" filepath="$PROJECT_DIR$/.idea/cultivation.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

1388
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -12,33 +12,33 @@ rust-version = "1.57"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "1.0.0-rc.8", features = [] }
tauri-build = { version = "1.2.0", features = [] }
cc = "1.0"
[target.'cfg(windows)'.dependencies]
is_elevated = "0.1.2"
registry = "1.2.1"
registry = "1.2.2"
[target.'cfg(unix)'.dependencies]
sudo = "0.6.0"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.6", features = ["api-all"] }
tauri = { version = "1.2.0", features = ["api-all"] }
# Access system process info.
sysinfo = "0.24.6"
sysinfo = "0.26.7"
# ZIP-archive library.
zip-extract = "0.1.1"
unrar = "0.4.4"
zip = "0.6.2"
zip = "0.6.3"
# For creating a "global" downloads list.
once_cell = "1.13.0"
once_cell = "1.16.0"
# Program opener.
open = "3.0.2"
open = "3.0.3"
duct = "0.13.5"
# Serialization.
@ -46,15 +46,15 @@ serde_json = "1"
# Dependencies for the HTTP(S) proxy.
http = "0.2"
hudsucker = "0.17.2"
tracing = "0.1.21"
tokio-rustls = "0.23.0"
tokio-tungstenite = "0.17.0"
tokio = { version = "1.18.2", features = ["signal"] }
rustls-pemfile = "1.0.0"
reqwest = { version = "0.11.3", features = ["stream"] }
futures-util = "0.3.14"
rcgen = { version = "0.9", features = ["x509-parser"] }
hudsucker = "0.18.0"
tracing = "0.1.37"
tokio-rustls = "0.23.4"
tokio-tungstenite = "0.17.2"
tokio = { version = "1.21.2", features = ["signal"] }
rustls-pemfile = "1.0.1"
reqwest = { version = "0.11.13", features = ["stream"] }
futures-util = "0.3.25"
rcgen = { version = "0.10", features = ["x509-parser"] }
# metadata stuff
regex = "1"

View File

@ -1,6 +1,3 @@
use std::process::exit;
use std::process::Command;
#[cfg(windows)]
pub fn reopen_as_admin() {
let install = std::env::current_exe().unwrap();

View File

@ -17,9 +17,9 @@ pub fn rename(path: String, new_name: String) {
new_path = path.replace('\\', "/");
}
let path_replaced = &path.replace(&new_path.split('/').last().unwrap(), &new_name);
let path_replaced = &path.replace(new_path.split('/').last().unwrap(), &new_name);
match fs::rename(&path, &path_replaced) {
match fs::rename(&path, path_replaced) {
Ok(_) => {
println!("Renamed {} to {}", &path, path_replaced);
}
@ -68,7 +68,7 @@ pub fn copy_file(path: String, new_path: String) -> bool {
}
// Copy old to new
match std::fs::copy(&path_buf, format!("{}/{}", new_path, filename)) {
match std::fs::copy(path_buf, format!("{}/{}", new_path, filename)) {
Ok(_) => true,
Err(e) => {
println!("Failed to copy file: {}", e);
@ -98,7 +98,7 @@ pub fn copy_file_with_new_name(path: String, new_path: String, new_name: String)
new_path_buf.push(new_name);
// Copy old to new
match std::fs::copy(&path_buf, &new_path_buf) {
match std::fs::copy(path_buf, &new_path_buf) {
Ok(_) => true,
Err(e) => {
println!("Failed to copy file: {}", e);
@ -147,7 +147,7 @@ pub fn write_file(path: String, contents: String) {
let path_buf = PathBuf::from(&path);
// Create file if it exists, otherwise just open and rewrite
let mut file = match fs::File::create(&path_buf) {
let mut file = match fs::File::create(path_buf) {
Ok(file) => file,
Err(e) => {
println!("Failed to open file: {}", e);

View File

@ -9,7 +9,7 @@ pub async fn get_lang(window: tauri::Window, lang: String) -> String {
let lang_path: PathBuf = [&install_location(), "lang", &format!("{}.json", lang)]
.iter()
.collect();
match std::fs::read_to_string(&lang_path) {
match std::fs::read_to_string(lang_path) {
Ok(x) => x,
Err(e) => {
emit_lang_err(window, format!("Failed to read language file: {}", e));

View File

@ -2,6 +2,7 @@
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
#![deny(clippy::all, unused)]
use file_helpers::dir_exists;
use once_cell::sync::Lazy;
@ -15,6 +16,7 @@ use tauri::async_runtime::block_on;
use std::thread;
use sysinfo::{System, SystemExt};
#[cfg(windows)]
use crate::admin::reopen_as_admin;
mod admin;
@ -40,7 +42,7 @@ fn has_arg(args: &[String], arg: &str) -> bool {
async fn arg_handler(args: &[String]) {
if has_arg(args, "--proxy") {
let mut pathbuf = tauri::api::path::data_dir().unwrap();
let mut pathbuf = data_dir().unwrap();
pathbuf.push("cultivation");
pathbuf.push("ca");
@ -56,12 +58,13 @@ fn main() {
println!("You running as a non-elevated user. Some stuff will almost definitely not work.");
println!("===============================================================================");
#[cfg(windows)]
reopen_as_admin();
}
// Setup datadir/cultivation just in case something went funky and it wasn't made
if !dir_exists(data_dir().unwrap().join("cultivation").to_str().unwrap()) {
fs::create_dir_all(&data_dir().unwrap().join("cultivation")).unwrap();
fs::create_dir_all(data_dir().unwrap().join("cultivation")).unwrap();
}
// Always set CWD to the location of the executable.

View File

@ -39,7 +39,7 @@ pub fn patch_metadata(metadata_folder: &str) -> bool {
let mut file = match OpenOptions::new()
.create(true)
.write(true)
.open(&(metadata_folder.to_owned() + "\\global-metadata-patched.dat"))
.open(metadata_folder.to_owned() + "\\global-metadata-patched.dat")
{
Ok(file) => file,
Err(e) => {

View File

@ -27,7 +27,7 @@ pub fn run_program_relative(path: String, args: Option<String>) {
open::that(format!("{} {}", &path, args.unwrap_or_else(|| "".into()))).unwrap_or(());
// Restore the original working directory
std::env::set_current_dir(&cwd).unwrap();
std::env::set_current_dir(cwd).unwrap();
}
#[tauri::command]
@ -52,7 +52,7 @@ pub fn run_command(program: &str, args: Vec<&str>, relative: Option<bool>) {
cmd(prog, args).run().unwrap();
// Restore the original working directory
std::env::set_current_dir(&cwd).unwrap();
std::env::set_current_dir(cwd).unwrap();
});
}