mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
Don't auto create assets folder (#11218)
# Objective - Don't automatically create an assets folder - resolves #11208 ## Solution - Removes directory creation from file reader. - Clearer panic when using file watcher and asset folder doesn't exist --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: Nicola Papale <nicopap@users.noreply.github.com>
This commit is contained in:
parent
371cd69d4b
commit
2847cc6933
2 changed files with 2 additions and 9 deletions
|
@ -6,7 +6,6 @@ mod file_asset;
|
|||
#[cfg(not(feature = "multi-threaded"))]
|
||||
mod sync_file_asset;
|
||||
|
||||
use bevy_log::warn;
|
||||
#[cfg(feature = "file_watcher")]
|
||||
pub use file_watcher::*;
|
||||
|
||||
|
@ -45,12 +44,6 @@ impl FileAssetReader {
|
|||
/// See `get_base_path` below.
|
||||
pub fn new<P: AsRef<Path>>(path: P) -> Self {
|
||||
let root_path = Self::get_base_path().join(path.as_ref());
|
||||
if let Err(e) = std::fs::create_dir_all(&root_path) {
|
||||
warn!(
|
||||
"Failed to create root directory {:?} for file asset reader: {:?}",
|
||||
root_path, e
|
||||
);
|
||||
}
|
||||
Self { root_path }
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ impl<'a> AssetSourceId<'a> {
|
|||
}
|
||||
|
||||
/// Returns [`None`] if this is [`AssetSourceId::Default`] and [`Some`] containing the
|
||||
/// the name if this is [`AssetSourceId::Name`].
|
||||
/// name if this is [`AssetSourceId::Name`].
|
||||
pub fn as_str(&self) -> Option<&str> {
|
||||
match self {
|
||||
AssetSourceId::Default => None,
|
||||
|
@ -486,7 +486,7 @@ impl AssetSource {
|
|||
sender,
|
||||
file_debounce_wait_time,
|
||||
)
|
||||
.unwrap(),
|
||||
.expect("Failed to create file watcher"),
|
||||
));
|
||||
#[cfg(any(
|
||||
not(feature = "file_watcher"),
|
||||
|
|
Loading…
Reference in a new issue