bevy icon indicating copy to clipboard operation
bevy copied to clipboard

auto create imported asset folder if needed

Open mockersf opened this issue 1 year ago • 2 comments
trafficstars

Objective

  • Since #11218, example asset_processing fails:
thread 'main' panicked at crates/bevy_asset/src/io/source.rs:489:18:
Failed to create file watcher: Error { kind: PathNotFound, paths: ["examples/asset/processing/imported_assets/Default"] }

start from a fresh git clone or delete the folder before running to reproduce, it is in gitignore and should not be present on a fresh run https://github.com/bevyengine/bevy/blob/a6574786757c0a0a7ddffb99fdc40ce90980fc82/.gitignore#L18

Solution

  • Auto create the imported_assets folder if it is configured

mockersf avatar Jan 10 '24 06:01 mockersf

In other words, instead of what was done previously, where file system control was given to the reader, should it be given to the writer instead?

That would result in the same situation as before #11218, and the assets folder created when not needed

mockersf avatar Jan 10 '24 20:01 mockersf

Ahhh yeah of course, somehow misunderstood FileAssetWriter::new to be the file initializer, instead of it setting the base path of the writer, so it would end up creating the assets folder. I'll delete the question

TheoDulka avatar Jan 10 '24 22:01 TheoDulka