Skip to content

Commit

Permalink
removed accidential http.wasm file; fixed incorrect logic for downl…
Browse files Browse the repository at this point in the history
…oad output path
  • Loading branch information
calvinrp committed May 7, 2024
1 parent 09151ca commit 6f383df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Binary file removed http.wasm
Binary file not shown.
11 changes: 9 additions & 2 deletions src/commands/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ impl DownloadCommand {
if let Some(path) = self
.output
.map(|mut p| {
if p.is_file() {
if p.extension()
.is_some_and(|ext| ext.eq_ignore_ascii_case("wasm"))
{
p
} else {
p.push(&default_file_name);
Expand All @@ -81,7 +83,12 @@ impl DownloadCommand {
}
})
{
std::fs::copy(download.path, path)?;
std::fs::copy(download.path, &path)?;
println!(
"Wrote `{name}` to {path}",
name = self.name,
path = path.display(),
);
}

Ok(())
Expand Down

0 comments on commit 6f383df

Please sign in to comment.