Skip to content

Commit ad306a3

Browse files
committed
New project companyName and productName replaced
1 parent 30f5717 commit ad306a3

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nomnom-unity-hub",
33
"private": true,
4-
"version": "1.0.6",
4+
"version": "1.0.7",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/src/generate.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,18 @@ pub fn generate_project(app: &tauri::AppHandle, app_state: &tauri::State<'_, App
150150
std::fs::write(&package_lock_path, serde_json::to_string_pretty(&json_str)?)?;
151151
}
152152

153+
let project_settings_path = package_cache_dir_out
154+
.join("ProjectSettings")
155+
.join("ProjectSettings.asset");
156+
157+
if project_settings_path.is_file() {
158+
let project_settings = std::fs::read_to_string(&project_settings_path)?;
159+
let project_settings = project_settings
160+
.replace("companyName: ", "DefaultCompany")
161+
.replace("productName: ", &project_info.name.clone());
162+
std::fs::write(&project_settings_path, project_settings)?;
163+
}
164+
153165
// crate::project::update_project_open_time(app_state, package_cache_dir_out.clone(), app)?;
154166
// crate::project::cmd_open_project_in_editor(app.clone(), app_state.clone(), package_cache_dir_out.clone(), editor_version.clone())?;
155167

src-tauri/src/project.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ pub fn cmd_is_open_in_editor(project_path: PathBuf, editor_version: String, app_
365365
.ok_or(errors::str_error("Invalid project path"))?
366366
.to_string();
367367

368+
let project_name = format!("{} - ", project_name);
369+
368370
// needs to start with project_name and contain Unity editor_version near the end
369371
// todo: make sure this works fine on other platforms
370372
let contains_title = titles

src-tauri/tauri.conf.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"package": {
99
"productName": "Nomnoms Unity Hub",
10-
"version": "1.0.6"
10+
"version": "1.0.7"
1111
},
1212
"tauri": {
1313
"allowlist": {
@@ -33,9 +33,7 @@
3333
"http": {
3434
"all": true,
3535
"request": true,
36-
"scope": [
37-
"https://raw.githubusercontent.com/*"
38-
]
36+
"scope": ["https://raw.githubusercontent.com/*"]
3937
}
4038
},
4139
"windows": [

0 commit comments

Comments
 (0)