mirror of
https://github.com/getzola/zola
synced 2024-11-10 14:24:27 +00:00
74c090a637
* Add completion subcommand * Remove old completion scripts * Move completion logic
25 lines
743 B
Rust
25 lines
743 B
Rust
fn generate_pe_header() {
|
|
use time::OffsetDateTime;
|
|
|
|
let today = OffsetDateTime::now_utc();
|
|
let copyright = format!("Copyright © 2017-{} Vincent Prouillet", today.year());
|
|
let mut res = winres::WindowsResource::new();
|
|
// needed for MinGW cross-compiling
|
|
if cfg!(unix) {
|
|
res.set_windres_path("x86_64-w64-mingw32-windres");
|
|
}
|
|
res.set_icon("docs/static/favicon.ico");
|
|
res.set("LegalCopyright", ©right);
|
|
res.compile().expect("Failed to compile Windows resources!");
|
|
}
|
|
|
|
fn main() {
|
|
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() != "windows"
|
|
&& std::env::var("PROFILE").unwrap() != "release"
|
|
{
|
|
return;
|
|
}
|
|
if cfg!(windows) {
|
|
generate_pe_header();
|
|
}
|
|
}
|