mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
Merge branch 'main' of github.com:Grasscutters/Cultivation
This commit is contained in:
@@ -138,19 +138,11 @@ pub fn write_file(path: String, contents: String) {
|
|||||||
let path_buf = std::path::PathBuf::from(&path);
|
let path_buf = std::path::PathBuf::from(&path);
|
||||||
|
|
||||||
// Create file if it exists, otherwise just open and rewrite
|
// Create file if it exists, otherwise just open and rewrite
|
||||||
let mut file = match fs::File::open(&path_buf) {
|
let mut file = match fs::File::create(&path_buf) {
|
||||||
Ok(file) => file,
|
Ok(file) => file,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Failed to open file: {}", e);
|
println!("Failed to open file: {}", e);
|
||||||
|
return;
|
||||||
// attempt to create file. otherwise return
|
|
||||||
match fs::File::create(&path_buf) {
|
|
||||||
Ok(file) => file,
|
|
||||||
Err(e) => {
|
|
||||||
println!("Failed to create file: {}", e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export async function patchGame() {
|
|||||||
|
|
||||||
// Do we have a patch already?
|
// Do we have a patch already?
|
||||||
const patchedExists = await invoke('dir_exists', {
|
const patchedExists = await invoke('dir_exists', {
|
||||||
path: await getGameMetadataPath() + '\\global-metadata-patched.dat'
|
path: await getBackupMetadataPath() + '\\global-metadata-patched.dat'
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!patchedExists) {
|
if (!patchedExists) {
|
||||||
|
|||||||
Reference in New Issue
Block a user