Skip to content

Commit e167a26

Browse files
committed
chore: improved diagnostics when download fails
1 parent d0e8999 commit e167a26

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/nfpm.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ where
4848
"https://github.com/goreleaser/nfpm/releases/download/v{NFPM_VERSION}/{archive_name}"
4949
);
5050

51-
let mut res = ureq::get(url)
51+
let mut res = ureq::get(&url)
5252
.call()
53-
.context("downloading nfpm from Github.com")?;
53+
.with_context(|| format!("downloading nfpm from {url}"))?;
5454

5555
let body: &mut ureq::Body = res.body_mut();
5656
let archive_path = outdir.as_ref().join("nfpm.tar.gz");
@@ -98,9 +98,7 @@ where
9898
let path = entry.path().context("retrieving entry path")?;
9999
if let Some(file_name) = path.file_name() {
100100
if file_name.to_str() == Some("nfpm") {
101-
entry
102-
.unpack(&binary_path)
103-
.context("unpacking nfpm")?;
101+
entry.unpack(&binary_path).context("unpacking nfpm")?;
104102
return Ok(());
105103
}
106104
}

0 commit comments

Comments
 (0)