feat: spawn vite from tuono crate

This commit is contained in:
Valerio Ageno
2024-05-13 21:11:22 +02:00
parent 6ef526be73
commit 65f43b3caf
+21
View File
@@ -1,3 +1,24 @@
use std::path::Path;
use std::process::{Command, Stdio};
fn spawn_vite_process() -> std::io::Result<()> {
println!("Spawing vite process");
let current_dir = std::env::current_dir()?;
let vite_path = Path::new("node_modules/.bin/vite");
let vite = current_dir.join(vite_path);
dbg!(&vite);
let _ = Command::new(vite)
.arg("dev")
.stdout(Stdio::inherit())
.output()?;
Ok(())
}
pub fn run() {
println!("Running dev environment");
let _ = spawn_vite_process();
}