diff --git a/src/script.rs b/src/script.rs index 5288cca..755d462 100644 --- a/src/script.rs +++ b/src/script.rs @@ -1,5 +1,27 @@ use std::fs; use std::path::PathBuf; +use serde::{ Deserialize, Serialize }; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ScriptDescription { + pub name: String, + pub version: String, + pub hash: String, + pub repo: String, + #[serde(rename = "gitHash")] + pub git_hash: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ScriptConfig { + pub repo: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ScriptLocalConfig { + #[serde(rename = "indexPath")] + pub index_path: String, +} pub fn _get_script_base_path(base: &PathBuf, file_name: &str) -> PathBuf { let mut fn_chars = file_name.chars().take_while(|c| *c != '.');