File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,26 @@ struct Platform {
1616
1717const CONFIG_FILE : & str = "framework_tool_config.toml" ;
1818
19- pub fn load_config ( ) -> Option < util:: Platform > {
19+ #[ cfg( feature = "uefi" ) ]
20+ fn read_config_file ( ) -> String {
21+ crate :: uefi:: fs:: shell_read_file ( CONFIG_FILE )
22+ }
23+ #[ cfg( not( feature = "uefi" ) ) ]
24+ fn read_config_file ( ) -> String {
2025 let mut path = std:: env:: current_exe ( ) . unwrap ( ) ;
2126 path. pop ( ) ;
2227 path. push ( CONFIG_FILE ) ;
2328
24- let toml_str = if let Ok ( str) = std:: fs:: read_to_string ( path) {
29+ if let Ok ( str) = std:: fs:: read_to_string ( path) {
2530 str
2631 } else {
2732 path = CONFIG_FILE . into ( ) ;
2833 std:: fs:: read_to_string ( path) . unwrap ( )
29- } ;
34+ }
35+ }
36+
37+ pub fn load_config ( ) -> Option < util:: Platform > {
38+ let toml_str = read_config_file ( ) ;
3039
3140 let decoded: Config = toml:: from_str ( & toml_str) . unwrap ( ) ;
3241 println ! ( "{:?}" , decoded) ;
You can’t perform that action at this time.
0 commit comments