forked from getzola/zola
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
32 lines (27 loc) · 826 Bytes
/
build.rs
File metadata and controls
32 lines (27 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
fn generate_pe_header() {
use time::OffsetDateTime;
let today = OffsetDateTime::now_utc();
let copyright = format!("Copyright © 2017-{} Vincent Prouillet", today.year());
let mut res = tauri_winres::WindowsResource::new();
res.set_icon("docs/static/favicon.ico");
res.set("LegalCopyright", ©right);
res.compile().expect("Failed to compile Windows resources!");
}
include!("src/cli.rs");
fn generate_man_pages() {
use clap::CommandFactory;
let out_dir = std::env::var("OUT_DIR").unwrap();
let cmd = Cli::command();
clap_mangen::generate_to(cmd, out_dir).unwrap();
}
fn main() {
if std::env::var("PROFILE").unwrap() != "release" {
return;
}
if cfg!(windows) {
generate_pe_header();
}
if cfg!(unix) {
generate_man_pages();
}
}