base markdown book with code block syntax highlighting and fully embedded assets
This commit is contained in:
15
build.rs
Normal file
15
build.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use std::fs::{File, create_dir};
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
let dest_path = Path::new("themes/Catppuccin-Macchiato.tmTheme");
|
||||
|
||||
if !dest_path.exists() {
|
||||
let mut response = reqwest::blocking::get("https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/themes/Catppuccin%20Macchiato.tmTheme")
|
||||
.expect("Failed to download theme");
|
||||
|
||||
create_dir("themes").expect("Could not create themes dir");
|
||||
let mut file = File::create(dest_path).expect("Failed to create theme file");
|
||||
std::io::copy(&mut response, &mut file).expect("Failed to save theme");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user