From 39e6a2ccd234104f6524e66ffbdbcbbd8cb8c267 Mon Sep 17 00:00:00 2001 From: joergf2a Date: Fri, 25 Oct 2024 22:59:22 +1100 Subject: [PATCH] fix for registry_save_path --- crates/blenvy/src/registry/export_types.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/blenvy/src/registry/export_types.rs b/crates/blenvy/src/registry/export_types.rs index dd5d784..5e24fe2 100644 --- a/crates/blenvy/src/registry/export_types.rs +++ b/crates/blenvy/src/registry/export_types.rs @@ -1,19 +1,21 @@ use crate::{AssetRoot, BlenvyConfig}; use bevy::{ - log::info, - prelude::{AppTypeRegistry, ReflectComponent, ReflectResource, World}, + asset::io::file::FileAssetReader, + log::info, + prelude::{AppTypeRegistry, ReflectComponent, ReflectResource, World}, reflect::{TypeInfo, TypeRegistration, VariantInfo}, }; use serde_json::{json, Map, Value}; -use std::{fs::File, path::Path}; +use std::fs::File; pub fn export_types(world: &mut World) { let config = world .get_resource::() .expect("ExportComponentsConfig should exist at this stage"); + let base_path = FileAssetReader::get_base_path(); let asset_root = world.resource::(); - let registry_save_path = Path::join(&asset_root.0, &config.registry_save_path); + let registry_save_path = base_path.join(&asset_root.0).join(&config.registry_save_path); let writer = File::create(registry_save_path).expect("should have created schema file"); let components_to_filter_out = &config.registry_component_filter.clone();