Skip to content

Commit

Permalink
Fix docs.rs build
Browse files Browse the repository at this point in the history
Skip Swagger UI download on docs.rs build since it is sandboxed
environment.
  • Loading branch information
juhaku committed May 21, 2024
1 parent 72218c9 commit 360e23e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion utoipa-swagger-ui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "utoipa-swagger-ui"
description = "Swagger UI for utoipa"
version = "7.0.2"
version = "7.0.3"
edition = "2021"
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
4 changes: 4 additions & 0 deletions utoipa-swagger-ui/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const SWAGGER_UI_DOWNLOAD_URL: &str = "SWAGGER_UI_DOWNLOAD_URL";
const SWAGGER_UI_OVERWRITE_FOLDER: &str = "SWAGGER_UI_OVERWRITE_FOLDER";

fn main() {
if env::var("DOCS_RS").is_ok() {
println!("running docs.rs build, skip Swagger UI download, sandboxed environment");
return;
}
let target_dir = env::var("OUT_DIR").unwrap();
println!("OUT_DIR: {target_dir}");

Expand Down

0 comments on commit 360e23e

Please sign in to comment.