Skip to content

Commit b71380f

Browse files
authored
feat: Warn on unknown language. (#418)
1 parent 040cc4a commit b71380f

File tree

1 file changed

+8
-0
lines changed
  • crates/bevy_mod_scripting_core/src

1 file changed

+8
-0
lines changed

crates/bevy_mod_scripting_core/src/asset.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ pub(crate) fn dispatch_script_asset_events(
225225
let script_id = converter(path);
226226

227227
let language = settings.select_script_language(path);
228+
if language == Language::Unknown {
229+
let extension = path
230+
.path()
231+
.extension()
232+
.and_then(|ext| ext.to_str())
233+
.unwrap_or_default();
234+
warn!("A script {:?} was added but its language is unknown. Consider adding the {:?} extension to the `ScriptAssetSettings`.", &script_id, extension);
235+
}
228236
let metadata = ScriptMetadata {
229237
asset_id: *id,
230238
script_id,

0 commit comments

Comments
 (0)