Spaces:
Build error
Build error
File size: 316 Bytes
7f50f92 9f12f4b 7f50f92 9f12f4b 7f50f92 |
1 2 3 4 5 6 7 8 9 10 11 |
use std::fs;
use std::path::Path;
pub fn write_dynamic_component(name: &str, code: &str) -> std::io::Result<()> {
let dir = Path::new("./frontend/src/dynamic");
if !dir.exists() {
fs::create_dir_all(dir)?;
}
let file_path = dir.join(format!("{}.tsx", name));
fs::write(file_path, code)
} |