Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Bug fix #593

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frame/bin/src/external/provider/precompiled_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
10 changes: 6 additions & 4 deletions frame/supports/support-common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ impl Config {
&self,
name: impl AsRef<str>,
) -> Result<Option<(PathBuf, ConfigFormat)>, 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());
Expand All @@ -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;
}
Expand Down Expand Up @@ -201,6 +202,7 @@ impl Config {
}

fn load<T: DeserializeOwned>(&self, name: impl AsRef<str>) -> Result<T, BridgerError> {
let name = name.as_ref();
if !self.base_path.exists() {
return Err(std::io::Error::new(
std::io::ErrorKind::NotFound,
Expand All @@ -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()
))
})?;
Expand All @@ -223,7 +225,7 @@ impl Config {
"Failed to load config: {:?} in path: {:?} for name {}",
e,
path,
name.as_ref()
name
))
})?;
Ok(tc)
Expand Down
Loading