coloured terminal outputs
This commit is contained in:
		
							parent
							
								
									28a29b41ef
								
							
						
					
					
						commit
						09187ba76e
					
				
							
								
								
									
										4
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							@ -4,16 +4,20 @@
 | 
			
		||||
        "axum",
 | 
			
		||||
        "chrono",
 | 
			
		||||
        "color",
 | 
			
		||||
        "colored",
 | 
			
		||||
        "Conn",
 | 
			
		||||
        "dotenv",
 | 
			
		||||
        "hmac",
 | 
			
		||||
        "minisign",
 | 
			
		||||
        "oneshot",
 | 
			
		||||
        "openapi",
 | 
			
		||||
        "postgres",
 | 
			
		||||
        "recv",
 | 
			
		||||
        "repr",
 | 
			
		||||
        "serde",
 | 
			
		||||
        "Servable",
 | 
			
		||||
        "sqlx",
 | 
			
		||||
        "tokio",
 | 
			
		||||
        "utoipa"
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										14
									
								
								src/cli.rs
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/cli.rs
									
									
									
									
									
								
							@ -1,6 +1,7 @@
 | 
			
		||||
use std::{collections::HashSet, path::PathBuf};
 | 
			
		||||
 | 
			
		||||
use clap::{command, Parser, Subcommand};
 | 
			
		||||
use colored::Colorize;
 | 
			
		||||
use error_stack::{Report, ResultExt};
 | 
			
		||||
use sqlx::PgPool;
 | 
			
		||||
use tokio::sync::mpsc::UnboundedReceiver;
 | 
			
		||||
@ -97,7 +98,8 @@ impl Cli {
 | 
			
		||||
                        windows::install_service()?;
 | 
			
		||||
 | 
			
		||||
                        // Print success message
 | 
			
		||||
                        println!("Succssfully installed service {APP_NAME}");
 | 
			
		||||
                        let msg = format!("Successfully installed service {APP_NAME}").green();
 | 
			
		||||
                        println!("{msg}");
 | 
			
		||||
 | 
			
		||||
                        Ok(DaemonStatus::NotRunning)
 | 
			
		||||
                    }
 | 
			
		||||
@ -106,7 +108,8 @@ impl Cli {
 | 
			
		||||
                        windows::uninstall_service()?;
 | 
			
		||||
 | 
			
		||||
                        // Print success message
 | 
			
		||||
                        println!("Succssfully removed service {APP_NAME}");
 | 
			
		||||
                        let msg = format!("Successfully removed service {APP_NAME}").green();
 | 
			
		||||
                        println!("{msg}");
 | 
			
		||||
 | 
			
		||||
                        Ok(DaemonStatus::NotRunning)
 | 
			
		||||
                    }
 | 
			
		||||
@ -141,7 +144,12 @@ impl Cli {
 | 
			
		||||
                        create_api_key(&pool, &key).await.change_context(AppError)?;
 | 
			
		||||
 | 
			
		||||
                        // print API key secret to console
 | 
			
		||||
                        println!("Created API Key: {}.{key_secret}", key.id);
 | 
			
		||||
                        println!(
 | 
			
		||||
                            "{}: {}.{}",
 | 
			
		||||
                            "Created API Key".green().bold(),
 | 
			
		||||
                            key.id.bold(),
 | 
			
		||||
                            key_secret.bold()
 | 
			
		||||
                        );
 | 
			
		||||
 | 
			
		||||
                        Ok(DaemonStatus::NotRunning)
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user