(modes: &[RunnerMode])
| 134 | } |
| 135 | |
| 136 | pub fn status(modes: &[RunnerMode]) -> Result<()> { |
| 137 | let system_info = SystemInfo::new()?; |
| 138 | info!("{}", style("Tools").bold()); |
| 139 | for executor in get_executors_from_modes(modes) { |
| 140 | // Don't probe for tooling that can't be used on this OS anyway. |
| 141 | if executor.support_level(&system_info) == ExecutorSupport::Unsupported { |
| 142 | continue; |
| 143 | } |
| 144 | let installed = match executor.tool_status() { |
| 145 | Some(tool_status) => match &tool_status.status { |
| 146 | ToolInstallStatus::Installed { version } => { |
| 147 | info!( |
| 148 | " {} {} executor: {} ({})", |
| 149 | check_mark(), |
| 150 | executor.name(), |
| 151 | tool_status.tool_name, |
| 152 | version |
| 153 | ); |
| 154 | true |
| 155 | } |
| 156 | ToolInstallStatus::IncorrectVersion { version, message } => { |
| 157 | info!( |
| 158 | " {} {} executor: {} ({}, {})", |
| 159 | warn_mark(), |
| 160 | executor.name(), |
| 161 | tool_status.tool_name, |
| 162 | version, |
| 163 | message |
| 164 | ); |
| 165 | false |
| 166 | } |
| 167 | ToolInstallStatus::NotInstalled => { |
| 168 | info!( |
| 169 | " {} {} executor: {} (not installed)", |
| 170 | cross_mark(), |
| 171 | executor.name(), |
| 172 | tool_status.tool_name |
| 173 | ); |
| 174 | false |
| 175 | } |
| 176 | }, |
| 177 | None => { |
| 178 | info!( |
| 179 | " {} {} executor: No tool to install", |
| 180 | check_mark(), |
| 181 | executor.name() |
| 182 | ); |
| 183 | true |
| 184 | } |
| 185 | }; |
| 186 | |
| 187 | if installed { |
| 188 | match executor.privilege_status() { |
| 189 | Some(PrivilegeStatus::Satisfied { detail }) => { |
| 190 | info!(" {} privileges: {}", check_mark(), detail); |
| 191 | } |
| 192 | Some(PrivilegeStatus::Missing { message }) => { |
| 193 | info!(" {} privileges: {}", cross_mark(), message); |
no test coverage detected