feat: add script config struct
This commit is contained in:
@@ -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 != '.');
|
||||
|
||||
Reference in New Issue
Block a user