removed colored library, using nu-ansi-term now

This commit is contained in:
2025-11-09 21:54:22 +01:00
parent bb82dad4cf
commit f7a1f84730
5 changed files with 55 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
use colored::Colorize;
use nu_ansi_term::Color::Green;
use futures::StreamExt;
use live_server::listen;
use notify::{
@@ -21,15 +21,18 @@ async fn watch_and_build() {
.expect("something went wrong")
}
async fn start_server(port: Option<u16>) {
let unwrapped_port = port.unwrap_or(8080);
let port = port.unwrap_or(8080);
let link = &format!("http://localhost:{}", port);
let hyperlink = Green.paint(link).hyperlink(link);
println!(
"\nServing at {}{} ",
"http://localhost:".bold(),
unwrapped_port.to_string().bold()
"\nServing at {}",
hyperlink
);
let Ok(()) = listen("localhost", port.unwrap_or(8080), "./dist").await else {
let Ok(()) = listen("localhost", port, "./dist").await else {
panic!("could not start server")
};
}