MCPcopy Create free account
hub / github.com/PerroEngine/Perro / copy_dir_recursive

Function copy_dir_recursive

perro_editor/res/scripts/assets/editor_assets.rs:1124–1139  ·  view source on GitHub ↗
(source: &Path, target: &Path)

Source from the content-addressed store, hash-verified

1122 };
1123 match result {
1124 Ok(()) => {
1125 let _ = with_state_mut!(ctx.run, EditorState, ctx.id, |state| {
1126 if let Ok(paths) = scan_res_paths(Path::new(&state.project_root)) {
1127 state.file_paths = paths;
1128 }
1129 state.sidebar_mode = "files".to_string();
1130 state.activity_mode = "scene".to_string();
1131 state.active_asset_path = target.clone();
1132 state.file_scope = parent_res_folder(&target);
1133 reveal_file_path_in_tree(state, &target);
1134 state.log = format!("dup asset\n{target}");
1135 });
1136 refresh_all(ctx);
1137 }
1138 Err(err) => set_log(ctx, &format!("dup asset fail\n{source}\n{err}")),
1139 }
1140}
1141
1142pub fn copy_active_asset_path<API: ScriptAPI + ?Sized>(ctx: &mut ScriptContext<'_, API>) {

Callers 1

duplicate_active_assetFunction · 0.85

Calls 3

read_dirFunction · 0.85
joinMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected