assets need names

This commit is contained in:
softprops 2019-08-25 23:33:39 -04:00
parent d2478527cf
commit c7f2407010
2 changed files with 11 additions and 8 deletions

View file

@ -6,6 +6,7 @@ use reqwest::Client;
use serde::Deserialize;
use std::{
error::Error,
ffi::OsStr,
fs::File,
path::{Path, PathBuf},
};
@ -95,17 +96,17 @@ fn run(
if let Some(patterns) = conf.input_files {
for path in paths(patterns)? {
println!(
"⬆️ Uploading {} asset {}",
mime_or_default(&path),
path.display()
);
println!("⬆️ Uploading asset {}", path.display());
let status = uploader.upload(
conf.github_token.as_str(),
conf.github_repository.as_str(),
id,
&path
.file_name()
.and_then(OsStr::to_str)
.unwrap_or_else(|| "Unknown file"),
mime_or_default(&path),
File::open(path)?,
File::open(&path)?,
)?;
println!("uploaded with status {}", status);
}