Skip to content
Merged
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
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ opt-level = 3
[dependencies]
age = { version = "0.11", features = ["ssh"] }
aho-corasick = "1"
anyhow = "1"
async-backtrace = "0.2"
async-trait = "0.1"
aws-config = { version = "1.5", default-features = false, features = [
Expand Down
18 changes: 1 addition & 17 deletions src/backend/static_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,6 @@ pub trait VerifiableError: Sized + Send + Sync + 'static {
}

impl VerifiableError for eyre::Report {
fn is_not_found(&self) -> bool {
self.chain().any(|cause| {
if let Some(err) = cause.downcast_ref::<reqwest::Error>() {
err.status() == Some(reqwest::StatusCode::NOT_FOUND)
} else {
false
}
})
}

fn into_eyre(self) -> eyre::Report {
self
}
}

impl VerifiableError for anyhow::Error {
fn is_not_found(&self) -> bool {
if self.to_string().contains("404") {
return true;
Expand All @@ -116,7 +100,7 @@ impl VerifiableError for anyhow::Error {
}

fn into_eyre(self) -> eyre::Report {
eyre::eyre!(self)
self
}
}

Expand Down
13 changes: 5 additions & 8 deletions src/backend/ubi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,9 @@ impl Backend for UbiBackend {

// Use lockfile URL if available, otherwise fall back to standard resolution
if let Some(url) = &lockfile_url {
install(url, &v, &bin_dir, extract_all, &opts)
.await
.map_err(|e| eyre::eyre!(e))?;
install(url, &v, &bin_dir, extract_all, &opts).await?;
} else if name_is_url(&self.tool_name()) {
install(&self.tool_name(), &v, &bin_dir, extract_all, &opts)
.await
.map_err(|e| eyre::eyre!(e))?;
install(&self.tool_name(), &v, &bin_dir, extract_all, &opts).await?;
} else {
try_with_v_prefix(&v, None, |candidate| {
let opts = opts.clone();
Expand Down Expand Up @@ -466,7 +462,7 @@ async fn install(
bin_dir: &Path,
extract_all: bool,
opts: &ToolVersionOptions,
) -> anyhow::Result<()> {
) -> eyre::Result<()> {
let mut builder = UbiBuilder::new().install_dir(bin_dir);

if name_is_url(name) {
Expand Down Expand Up @@ -508,7 +504,7 @@ async fn install(
builder = set_enterprise_token(builder, &forge);
}

let mut ubi = builder.build()?;
let mut ubi = builder.build().map_err(|e| eyre::eyre!("{e:#}"))?;
Comment thread
risu729 marked this conversation as resolved.

// TODO: hacky but does not compile without it
tokio::task::block_in_place(|| {
Expand All @@ -519,5 +515,6 @@ async fn install(
.unwrap()
});
RT.block_on(async { ubi.install_binary().await })
.map_err(|e| eyre::eyre!("{e:#}"))
Comment thread
greptile-apps[bot] marked this conversation as resolved.
})
}
Loading