-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have no idea how I overlooked this but lua dumps were broken if they weren't at the top level of the dump folder. * All files dumped now automatically have .lua attached (even if they didn't already have it) * Initial plugin code * Bump to 1.0.0-beta5
- Loading branch information
Showing
6 changed files
with
58 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "autorun" | ||
version = "1.0.0-beta4" | ||
version = "1.0.0-beta5" | ||
authors = ["Vurv78 <[email protected]>"] | ||
edition = "2021" | ||
publish = false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ mod global; | |
mod hooks; | ||
mod lua; | ||
mod util; | ||
mod plugins; | ||
|
||
use logging::*; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use crate::configs::PLUGIN_DIR; | ||
|
||
#[derive(Debug, thiserror::Error)] | ||
pub enum PluginError { | ||
#[error("IO Error: {0}")] | ||
IO(#[from] std::io::Error) | ||
} | ||
|
||
#[non_exhaustive] | ||
pub enum PluginLanguage { | ||
// In the future there could be more languages like Teal or Expressive | ||
Lua | ||
} | ||
|
||
impl Default for PluginLanguage { | ||
fn default() -> Self { Self::Lua } | ||
} | ||
|
||
#[derive(Default)] | ||
pub struct PluginSettings { | ||
language: PluginLanguage | ||
} | ||
|
||
pub struct Plugin { | ||
name: String, | ||
path: std::path::PathBuf, | ||
|
||
// Path to entrypoint file. | ||
autorun: std::path::PathBuf, | ||
|
||
// Retrieved from plugin.toml | ||
settings: PluginSettings | ||
} | ||
|
||
// Plugin system | ||
pub fn find() -> Result<(), PluginError> { | ||
let dir = std::fs::read_dir( PLUGIN_DIR )?; | ||
|
||
Ok(()) | ||
} | ||
|
||
pub fn exec() -> Result<(), PluginError> { | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters