Merge branch 'main' of github.com:Grasscutters/Cultivation

This commit is contained in:
SpikeHD 2022-07-19 17:14:59 -07:00
commit 18a1b0e94c
2 changed files with 4 additions and 12 deletions

View File

@ -138,19 +138,11 @@ pub fn write_file(path: String, contents: String) {
let path_buf = std::path::PathBuf::from(&path);
// 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,
Err(e) => {
println!("Failed to open file: {}", e);
// attempt to create file. otherwise return
match fs::File::create(&path_buf) {
Ok(file) => file,
Err(e) => {
println!("Failed to create file: {}", e);
return;
}
}
return;
}
};

View File

@ -72,7 +72,7 @@ export async function patchGame() {
// Do we have a patch already?
const patchedExists = await invoke('dir_exists', {
path: await getGameMetadataPath() + '\\global-metadata-patched.dat'
path: await getBackupMetadataPath() + '\\global-metadata-patched.dat'
})
if (!patchedExists) {
@ -225,4 +225,4 @@ export async function restoreMetadata(manager: DownloadHandler) {
await unpatchGame()
return true
}
}