/*
    This file is part of jellything (https://codeberg.org/metamuffin/jellything)
    which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
    Copyright (C) 2026 metamuffin <metamuffin.org>
*/

use std::{
    fs::{File, read_to_string},
    io::Write,
    path::PathBuf,
};
fn main() {
    println!("cargo:rerun-if-changed=build.rs");
    let mut out = String::new();
    for file in glob::glob("src/**/*.css").unwrap().map(Result::unwrap) {
        println!("cargo:rerun-if-changed={}", file.to_str().unwrap());
        out += &read_to_string(file).unwrap();
    }
    let outpath: PathBuf = std::env::var("OUT_DIR").unwrap().try_into().unwrap();
    File::create(outpath.join("bundle.css"))
        .unwrap()
        .write_all(out.as_bytes())
        .unwrap();
}
