Compare commits

...

2 Commits

Author SHA1 Message Date
NotThorny
f61f4eed51 Bump version 2025-11-14 15:24:14 -07:00
NotThorny
99b45ddf52 Fix reading profile path 2025-11-14 15:24:14 -07:00
4 changed files with 10 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "cultivation", "name": "cultivation",
"version": "1.7.0", "version": "1.7.1",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@tauri-apps/api": "^1.0.0-rc.5", "@tauri-apps/api": "^1.0.0-rc.5",

View File

@@ -40,22 +40,22 @@ pub fn config_path(profile: String) -> PathBuf {
if profile.as_str() == "default" { if profile.as_str() == "default" {
path.push("configuration.json"); path.push("configuration.json");
} else { } else {
path.push("profile"); path.push("profiles");
path.push(profile); path.push(profile + ".json");
} }
path path
} }
pub fn get_config(profile_name: String) -> Configuration { pub fn get_config(profile_name: String) -> Configuration {
let path = config_path(profile_name); let path = config_path(profile_name.clone());
let config = std::fs::read_to_string(path).unwrap_or("{}".to_string()); let config = std::fs::read_to_string(path).unwrap_or("{}".to_string());
let config: Configuration = serde_json::from_str(&config).unwrap_or_default(); let config: Configuration = serde_json::from_str(&config).unwrap_or_default();
let default = String::from("default"); //let default = String::from("default");
let prof = config.profile.as_ref().unwrap_or(&default); let prof = config.profile.clone().unwrap_or_default();
if *prof != String::from("default") { if prof != String::from("default") && prof != profile_name.clone() {
get_config(prof.clone()); return get_config(prof.clone());
} }
config config

View File

@@ -7,7 +7,7 @@
}, },
"package": { "package": {
"productName": "Cultivation", "productName": "Cultivation",
"version": "1.7.0" "version": "1.7.1"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {

View File

@@ -143,7 +143,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
<tr> <tr>
<td> <td>
Work in progress area! These numbers may be outdated, so please do not use them as reference. Latest Work in progress area! These numbers may be outdated, so please do not use them as reference. Latest
version: Grasscutter 1.7.4 (4.0) / Forks (6.1) - Cultivation 1.7.0 version: Grasscutter 1.7.4 (4.0) / Forks (6.1) - Cultivation 1.7.1
</td> </td>
</tr> </tr>
) )