From 8f6571c50f9b1377837179cdb664ee6ad10836c7 Mon Sep 17 00:00:00 2001 From: fewensa Date: Wed, 27 Sep 2023 09:41:16 +0000 Subject: [PATCH] fix issues --- frame/bin/src/external/provider/precompiled_binary.rs | 2 ++ frame/supports/support-common/src/config.rs | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frame/bin/src/external/provider/precompiled_binary.rs b/frame/bin/src/external/provider/precompiled_binary.rs index 783e1578e..aa9a577ea 100644 --- a/frame/bin/src/external/provider/precompiled_binary.rs +++ b/frame/bin/src/external/provider/precompiled_binary.rs @@ -284,6 +284,8 @@ impl PrecompiledBinaryExecutor { "x86" } else if cfg!(target_arch = "x86_64") { "x86_64" + } else if cfg!(target_arch = "aarch64") { + "aarch64" } else { return Err(BridgerError::Subcommand( "Can not support current architecture".to_string(), diff --git a/frame/supports/support-common/src/config.rs b/frame/supports/support-common/src/config.rs index c4d2828b5..b3ab620eb 100644 --- a/frame/supports/support-common/src/config.rs +++ b/frame/supports/support-common/src/config.rs @@ -135,6 +135,7 @@ impl Config { &self, name: impl AsRef, ) -> Result, BridgerError> { + let name = name.as_ref(); let mut config_file = None; if !self.base_path.exists() { tracing::warn!(target: "bridger", "The base_path ({}) is not found.", self.base_path.display()); @@ -153,7 +154,7 @@ impl Config { }, None => continue, }; - if file_name.starts_with(name.as_ref()) { + if file_name.starts_with(name) && file_name.contains('.') { config_file = Some(file); break; } @@ -201,6 +202,7 @@ impl Config { } fn load(&self, name: impl AsRef) -> Result { + let name = name.as_ref(); if !self.base_path.exists() { return Err(std::io::Error::new( std::io::ErrorKind::NotFound, @@ -209,10 +211,10 @@ impl Config { .into()); } - let (path, _) = self.find_config_file(name.as_ref())?.ok_or_else(|| { + let (path, _) = self.find_config_file(name)?.ok_or_else(|| { BridgerError::Config(format!( "Not found config file for name: {} in path: {}", - name.as_ref(), + name, self.base_path.display() )) })?; @@ -223,7 +225,7 @@ impl Config { "Failed to load config: {:?} in path: {:?} for name {}", e, path, - name.as_ref() + name )) })?; Ok(tc)