@@ -5,17 +5,21 @@ use std::{
55 io:: { Read , Write } ,
66 path:: { Path , PathBuf } ,
77} ;
8- use std :: str :: FromStr ;
8+
99use ethers:: types:: ValueOrArray ;
1010use regex:: { Captures , Regex } ;
1111use serde:: { Deserialize , Serialize } ;
1212use tracing:: error;
1313
14- use crate :: { abi:: ABIItem , helpers:: replace_env_variable_to_raw_name, load_env_from_project_path, manifest:: {
15- core:: { Manifest , ProjectType } ,
16- network:: Network ,
17- } , StringOrArray } ;
18- use crate :: helpers:: load_env_from_full_path;
14+ use crate :: {
15+ abi:: ABIItem ,
16+ helpers:: { load_env_from_full_path, replace_env_variable_to_raw_name} ,
17+ manifest:: {
18+ core:: { Manifest , ProjectType } ,
19+ network:: Network ,
20+ } ,
21+ StringOrArray ,
22+ } ;
1923
2024pub const YAML_CONFIG_NAME : & str = "rindexer.yaml" ;
2125
@@ -273,17 +277,14 @@ struct ManifestNetworksOnly {
273277
274278fn extract_environment_path ( contents : & str , file_path : & Path ) -> Option < PathBuf > {
275279 let re = Regex :: new ( r"(?m)^environment_path:\s*(.+)$" ) . unwrap ( ) ;
276- re. captures ( contents)
277- . and_then ( |cap| cap. get ( 1 ) )
278- . map ( |m| {
279- let path_str = m. as_str ( ) . trim ( ) . replace ( '\"' , "" ) ; // Remove any quotes
280- let base_dir = file_path. parent ( ) . unwrap_or ( Path :: new ( "" ) ) ;
281- let full_path = base_dir. join ( path_str) ;
282- full_path. canonicalize ( ) . unwrap_or ( full_path)
283- } )
280+ re. captures ( contents) . and_then ( |cap| cap. get ( 1 ) ) . map ( |m| {
281+ let path_str = m. as_str ( ) . trim ( ) . replace ( '\"' , "" ) ; // Remove any quotes
282+ let base_dir = file_path. parent ( ) . unwrap_or ( Path :: new ( "" ) ) ;
283+ let full_path = base_dir. join ( path_str) ;
284+ full_path. canonicalize ( ) . unwrap_or ( full_path)
285+ } )
284286}
285287
286-
287288pub fn read_manifest ( file_path : & PathBuf ) -> Result < Manifest , ReadManifestError > {
288289 let mut file = File :: open ( file_path) ?;
289290 let mut contents = String :: new ( ) ;
0 commit comments