@@ -3,12 +3,25 @@ use serde::{Deserialize, Serialize};
33use std:: fs;
44use std:: path:: PathBuf ;
55
6+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
7+ pub struct PluginConfig {
8+ pub enabled : bool , // 插件是否启用
9+ pub execute_home : String , // 插件的执行路径
10+ pub extensions : Vec < String > , // 插件支持的文件扩展名
11+ pub language : String , // 插件所属语言
12+ pub before_compile : String , // 插件在编译前执行的命令
13+ pub after_compile : String , // 插件在编译完成后执行的命令
14+ pub run_command : String , // 插件执行的命令
15+ pub template : String , // 插件的模板
16+ }
17+
618#[ derive( Debug , Clone , Serialize , Deserialize ) ]
719pub struct AppConfig {
820 pub log_directory : Option < String > ,
921 pub auto_clear_logs : Option < bool > ,
1022 pub keep_log_days : Option < u32 > ,
1123 pub theme : Option < String > ,
24+ pub plugins : Option < Vec < PluginConfig > > ,
1225}
1326
1427impl Default for AppConfig {
@@ -18,6 +31,7 @@ impl Default for AppConfig {
1831 auto_clear_logs : Some ( true ) ,
1932 keep_log_days : Some ( 30 ) ,
2033 theme : Some ( "system" . to_string ( ) ) ,
34+ plugins : Some ( vec ! [ ] ) ,
2135 }
2236 }
2337}
0 commit comments