@@ -5,5 +5,5 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.91"
|
||||
cuddle-actions = { git = "ssh://git@git.front.kjuulh.io/kjuulh/cuddle-v2", version = "0.2.0" }
|
||||
cuddle-actions-sdk = { git = "ssh://git@git.front.kjuulh.io/kjuulh/cuddle-v2", version = "0.2.0" }
|
||||
tokio = { version = "1.41.0", features = ["full"] }
|
||||
|
@@ -2,7 +2,7 @@ use cuddle_actions::AddActionOptions;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
cuddle_actions::CuddleActions::default()
|
||||
cuddle_actions_sdk::CuddleActions::default()
|
||||
.add_action(
|
||||
"something",
|
||||
|| {
|
||||
|
@@ -173,22 +173,23 @@ impl Drop for TempGuard {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
struct CuddleActionsSchema {
|
||||
actions: Vec<CuddleActionSchema>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
struct CuddleActionSchema {
|
||||
name: String,
|
||||
}
|
||||
|
||||
impl CuddleActionsSchema {
|
||||
fn to_executable(self, action_path: &Path) -> anyhow::Result<ExecutableActions> {
|
||||
fn to_executable(&self, action_path: &Path) -> anyhow::Result<ExecutableActions> {
|
||||
Ok(ExecutableActions {
|
||||
actions: self
|
||||
.actions
|
||||
.into_iter()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|a| {
|
||||
let name = a.name.clone();
|
||||
let action_path = action_path.to_string_lossy().to_string();
|
||||
|
Reference in New Issue
Block a user