Skip to content

Commit

Permalink
Add missing windows check to utoipa-swagger-ui build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
juhaku committed May 21, 2024
1 parent ffcd202 commit 139c035
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utoipa-swagger-ui/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ struct SwaggerUiDist;
fn download_file(url: &str, path: PathBuf) -> Result<(), Box<dyn Error>> {
let reqwest_feature = env::var("CARGO_FEATURE_REQWEST");
println!("reqwest feature: {reqwest_feature:?}");
if reqwest_feature.is_ok() {
if reqwest_feature.is_ok()
|| env::var("CARGO_CFG_TARGET_OS")
.map(|os| os == "windows")
.unwrap_or_default()
{
#[cfg(any(feature = "reqwest", target_os = "windows"))]
{
download_file_reqwest(url, path)?;
Expand Down

0 comments on commit 139c035

Please sign in to comment.