Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MLFlexer committed Jul 23, 2024
1 parent e6190f8 commit 800b0dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion config/src/lua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ pub fn make_lua_context(config_file: &Path) -> anyhow::Result<Lua> {
for dir in crate::CONFIG_DIRS.iter() {
prefix_path(&mut path_array, dir);
}
path_array.push(format!("{}/plugins/?/plugin/init.lua", crate::DATA_DIR.display()));
path_array.push(format!(
"{}/plugins/?/plugin/init.lua",
crate::DATA_DIR.display()
));

prefix_path(&mut path_array, &crate::DATA_DIR.join("plugins"));

Expand Down
13 changes: 7 additions & 6 deletions lua-api-crates/plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,17 @@ pub fn register(lua: &Lua) -> anyhow::Result<()> {
})?,
)?;

plugin_mod.set("require_as_alias",
plugin_mod.set(
"require_as_alias",
lua.create_function(|lua: &Lua, (repo_spec, alias): (String, String)| {
require_plugin_with_alias(lua, repo_spec, alias).map_err(|e| mlua::Error::external(format!("{e:#}")))
require_plugin_with_alias(lua, repo_spec, alias)
.map_err(|e| mlua::Error::external(format!("{e:#}")))
})?,
)?;

plugin_mod.set("plugin_dir",
lua.create_function(|lua: &Lua, _: ()| {
to_lua(lua, RepoSpec::plugins_dir())
})?,
plugin_mod.set(
"plugin_dir",
lua.create_function(|lua: &Lua, _: ()| to_lua(lua, RepoSpec::plugins_dir()))?,
)?;

plugin_mod.set(
Expand Down

0 comments on commit 800b0dc

Please sign in to comment.