|
1 | 1 | use {
|
2 | 2 | crate::onefetch::{
|
3 |
| - cli::Cli, commit_info::CommitInfo, deps, error::*, language::Language, license::Detector, |
4 |
| - repo::Repo, text_color::TextColor, |
| 3 | + cli::Cli, cli_utils, commit_info::CommitInfo, deps, error::*, language::Language, |
| 4 | + license::Detector, repo::Repo, text_color::TextColor, |
5 | 5 | },
|
6 | 6 | colored::{Color, ColoredString, Colorize},
|
7 | 7 | std::process::Command,
|
@@ -224,7 +224,7 @@ impl Info {
|
224 | 224 | let number_of_commits = Info::get_number_of_commits(&git_history);
|
225 | 225 | let authors = Info::get_authors(&git_history, config.number_of_authors);
|
226 | 226 | let last_change = Info::get_date_of_last_commit(&git_history)?;
|
227 |
| - let git_version = Info::get_git_version()?; |
| 227 | + let git_version = cli_utils::get_git_version()?; |
228 | 228 | let repo_size = Info::get_packed_size(&workdir)?;
|
229 | 229 | let license = Detector::new()?.get_license(&workdir)?;
|
230 | 230 | let dependencies = deps::DependencyDetector::new().get_dependencies(&workdir)?;
|
@@ -338,11 +338,6 @@ impl Info {
|
338 | 338 | number_of_commits.to_string()
|
339 | 339 | }
|
340 | 340 |
|
341 |
| - fn get_git_version() -> Result<String> { |
342 |
| - let version = Command::new("git").arg("--version").output()?; |
343 |
| - Ok(String::from_utf8_lossy(&version.stdout).replace('\n', "")) |
344 |
| - } |
345 |
| - |
346 | 341 | fn get_packed_size(dir: &str) -> Result<String> {
|
347 | 342 | let output = Command::new("git")
|
348 | 343 | .arg("-C")
|
|
0 commit comments