mirror of
https://github.com/lune-org/lune.git
synced 2025-05-04 10:43:57 +01:00
Start working on getting require semantics up to date
This commit is contained in:
parent
acd0f126e5
commit
a673f80c95
1 changed files with 5 additions and 1 deletions
|
@ -85,7 +85,11 @@ async fn require(lua: Lua, (source, path): (LuaString, LuaString)) -> LuaResult<
|
|||
"Require with custom alias must contain '/' delimiter",
|
||||
))?;
|
||||
alias::require(lua, &context, &source, alias, path).await
|
||||
} else {
|
||||
} else if path.starts_with("./") || path.starts_with("../") {
|
||||
path::require(lua, &context, &source, &path).await
|
||||
} else {
|
||||
Err(LuaError::runtime(
|
||||
"Require path must start with \"./\", \"../\" or \"@\"",
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue