Docker
All checks were successful
All checks were successful
This commit is contained in:
@@ -34,6 +34,9 @@ mime_guess = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
strum = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
reqwest = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
pdfium = ["dep:pdfium-render"]
|
||||
|
||||
@@ -69,11 +69,14 @@ fn main() {
|
||||
|
||||
eprintln!("cargo:warning=Downloading PDFium from {url}");
|
||||
|
||||
let status = std::process::Command::new("curl")
|
||||
.args(["-L", "--fail", "-o", tgz_path.to_str().unwrap(), &url])
|
||||
.status()
|
||||
.expect("failed to run curl");
|
||||
assert!(status.success(), "curl failed to download PDFium");
|
||||
let response = reqwest::blocking::get(&url).expect("failed to download PDFium");
|
||||
assert!(
|
||||
response.status().is_success(),
|
||||
"failed to download PDFium: {}",
|
||||
response.status()
|
||||
);
|
||||
let bytes = response.bytes().expect("failed to read PDFium response");
|
||||
std::fs::write(&tgz_path, &bytes).expect("failed to write pdfium.tgz");
|
||||
|
||||
let status = std::process::Command::new("tar")
|
||||
.args([
|
||||
|
||||
Reference in New Issue
Block a user