-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathstatus.rs
More file actions
39 lines (32 loc) · 953 Bytes
/
status.rs
File metadata and controls
39 lines (32 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use crate::VERSION;
use crate::api_client::CodSpeedAPIClient;
use crate::prelude::*;
use crate::system::SystemInfo;
use console::style;
pub fn check_mark() -> console::StyledObject<&'static str> {
style("✓").green()
}
pub fn cross_mark() -> console::StyledObject<&'static str> {
style("✗").red()
}
pub fn warn_mark() -> console::StyledObject<&'static str> {
style("!").yellow()
}
pub async fn run(api_client: &CodSpeedAPIClient) -> Result<()> {
// Auth status
super::auth::status(api_client).await?;
info!("");
// Setup/tools status
super::setup::status()?;
info!("");
// System info
info!("{}", style("System").bold());
info!(" codspeed {VERSION}");
let system_info = SystemInfo::new()?;
info!(" {} ({})", system_info.os, system_info.arch);
info!(
" {} ({}C / {}GB)",
system_info.cpu_brand, system_info.cpu_cores, system_info.total_memory_gb
);
Ok(())
}