~/hooky

hooky/victim/build.rs -rw-r--r-- 583 B
dfc58611 — Arthur Melton format all the rust code 2 years ago

            
9537b5f6 Arthur Melton
dfc58611 Arthur Melton
9537b5f6 Arthur Melton
4850b5ea Arthur Melton
9537b5f6 Arthur Melton
dfc58611 Arthur Melton
9537b5f6 Arthur Melton
df6fb4e9 Arthur Melton
9537b5f6 Arthur Melton
335dec98 Arthur Melton
9537b5f6 Arthur Melton






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::fs::File;
use std::io::prelude::*;

use config::Config;

fn main() {
    println!("cargo:rerun-if-changed=config.toml");
    let mut file = File::open("config.toml").expect("Unable to open the file");
    let mut contents = String::new();
    file.read_to_string(&mut contents)
        .expect("Unable to read the file");
    let config: Config = toml::from_str(&contents).expect("Cant convert to toml");
    if let Some(payload) = config.payload {
        println!("cargo:rustc-env=payload={}", payload);
    }
    println!("cargo:rustc-env=send_to={}", config.send_to);
}