@@ -150,6 +150,52 @@ pub fn generate_project(app: &tauri::AppHandle, app_state: &tauri::State<'_, App
150
150
std:: fs:: write ( & package_lock_path, serde_json:: to_string_pretty ( & json_str) ?) ?;
151
151
}
152
152
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 mut lines = project_settings. lines ( ) . map ( |x| x. to_string ( ) ) . collect :: < Vec < _ > > ( ) ;
160
+
161
+ for line in lines. iter_mut ( ) {
162
+ let trimmed_line = line. trim ( ) ;
163
+ if trimmed_line. starts_with ( "companyName: " ) {
164
+ * line = " companyName: DefaultCompany" . to_string ( ) ;
165
+ continue ;
166
+ }
167
+
168
+ if trimmed_line. starts_with ( "productName: " ) {
169
+ * line = format ! ( " productName: {}" , project_info. name. clone( ) ) ;
170
+ break ;
171
+ }
172
+ }
173
+
174
+ let project_settings = lines. join ( "\n " ) ;
175
+ std:: fs:: write ( & project_settings_path, project_settings) ?;
176
+ }
177
+
178
+ // let out_path = package_cache_dir_out
179
+ // .to_str()
180
+ // .ok_or(errors::str_error("Failed to convert path to string"))?
181
+ // .to_string();
182
+ // println!("out path: {}", out_path);
183
+
184
+ // let embedded_cs_script = include_str!("assets/PackageClientTest.cs");
185
+ // let embedded_cs_script_path = package_cache_dir_out
186
+ // .join("Assets")
187
+ // .join("PackageClientTest.cs");
188
+
189
+ // println!("writing script: {}", embedded_cs_script_path.display());
190
+ // std::fs::write(&embedded_cs_script_path, embedded_cs_script)?;
191
+
192
+ // println!("running script: {}", embedded_cs_script_path.display());
193
+ // crate::editor::open(template_info.editor_version.version.clone(), vec!["-quit".to_string(), "-batchmode".to_string(), "-projectPath".to_string(), format!("{}", out_path).to_string(), "-executeMethod".to_string(), "PackageClientTest.PerformCheck".to_string()], app_state, true)?;
194
+
195
+ // // delete script
196
+ // println!("deleting script: {}", embedded_cs_script_path.display());
197
+ // std::fs::remove_file(&embedded_cs_script_path)?;
198
+
153
199
// crate::project::update_project_open_time(app_state, package_cache_dir_out.clone(), app)?;
154
200
// crate::project::cmd_open_project_in_editor(app.clone(), app_state.clone(), package_cache_dir_out.clone(), editor_version.clone())?;
155
201
0 commit comments