mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 22:25:26 +00:00
Accept .luau files (#552)
* accept .luau files * Accept .luau in snapshot creation * Update versioning and snapshots. * fix versioning * Run rustfmt * Reduce repetition in extension detection * Tidy build script change Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
This commit is contained in:
@@ -57,16 +57,31 @@ pub fn snapshot_from_vfs(
|
||||
return snapshot_project(context, vfs, &project_path);
|
||||
}
|
||||
|
||||
let init_path = path.join("init.luau");
|
||||
if vfs.metadata(&init_path).with_not_found()?.is_some() {
|
||||
return snapshot_lua_init(context, vfs, &init_path);
|
||||
}
|
||||
|
||||
let init_path = path.join("init.lua");
|
||||
if vfs.metadata(&init_path).with_not_found()?.is_some() {
|
||||
return snapshot_lua_init(context, vfs, &init_path);
|
||||
}
|
||||
|
||||
let init_path = path.join("init.server.luau");
|
||||
if vfs.metadata(&init_path).with_not_found()?.is_some() {
|
||||
return snapshot_lua_init(context, vfs, &init_path);
|
||||
}
|
||||
|
||||
let init_path = path.join("init.server.lua");
|
||||
if vfs.metadata(&init_path).with_not_found()?.is_some() {
|
||||
return snapshot_lua_init(context, vfs, &init_path);
|
||||
}
|
||||
|
||||
let init_path = path.join("init.client.luau");
|
||||
if vfs.metadata(&init_path).with_not_found()?.is_some() {
|
||||
return snapshot_lua_init(context, vfs, &init_path);
|
||||
}
|
||||
|
||||
let init_path = path.join("init.client.lua");
|
||||
if vfs.metadata(&init_path).with_not_found()?.is_some() {
|
||||
return snapshot_lua_init(context, vfs, &init_path);
|
||||
@@ -74,7 +89,11 @@ pub fn snapshot_from_vfs(
|
||||
|
||||
snapshot_dir(context, vfs, path)
|
||||
} else {
|
||||
if let Ok(name) = path.file_name_trim_end(".lua") {
|
||||
let script_name = path
|
||||
.file_name_trim_end(".lua")
|
||||
.or_else(|_| path.file_name_trim_end(".luau"));
|
||||
|
||||
if let Ok(name) = script_name {
|
||||
match name {
|
||||
// init scripts are handled elsewhere and should not turn into
|
||||
// their own children.
|
||||
|
||||
Reference in New Issue
Block a user