Skip to content

Commit

Permalink
move creation date to its own line
Browse files Browse the repository at this point in the history
  • Loading branch information
o2sh committed Oct 10, 2019
1 parent 7b31ed5 commit d9bfb73
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "onefetch"
description = "Git project summary on your terminal"
version = "1.6.0"
version = "1.6.5"
authors = ["o2sh <ossama-hjaji@live.fr>"]
readme = "README.md"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<img src="https://raw.githubusercontent.com/o2sh/onefetch/master/assets/onefetch.png" height="130px"></h3><br><br>
<a href="https://crates.io/crates/onefetch"><img src="https://img.shields.io/badge/crates.io-1.6.0-red.svg" alt="cargo"></a>
<a href="https://crates.io/crates/onefetch"><img src="https://img.shields.io/badge/crates.io-1.6.5-orange.svg" alt="cargo"></a>
<a href="https://travis-ci.org/o2sh/onefetch"><img src="https://travis-ci.org/o2sh/onefetch.svg?branch=master" alt="Build Status"></a>
<a href="./LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
</p>
Expand Down
Binary file modified assets/cpp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/dart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 11 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct Info {
project_name: String,
current_commit: CommitInfo,
version: String,
creation_date: String,
dominant_language: Language,
languages: Vec<(Language, f64)>,
authors: Vec<(String, usize, usize)>,
Expand Down Expand Up @@ -70,6 +71,13 @@ impl fmt::Display for Info {
self.version
)?;

writeln!(
buffer,
"{}{}",
"Created: ".color(color).bold(),
self.creation_date
)?;

if !self.languages.is_empty() {
if self.languages.len() > 1 {
let title = "Languages: ";
Expand Down Expand Up @@ -363,15 +371,13 @@ fn main() -> Result<()> {
let commits = get_commits(&dir)?;
let repo_size = get_packed_size(&dir)?;
let last_change = get_last_change(&dir)?;
let project_name = match get_creation_time() {
Some(creation_time) => format!("{}, {}", config.repository_name, creation_time),
None => config.repository_name
};
let creation_date = get_creation_time().unwrap();

let info = Info {
project_name,
project_name: config.repository_name,
current_commit: current_commit_info,
version,
creation_date: creation_date,
dominant_language,
languages: languages_stat_vec,
authors,
Expand Down

0 comments on commit d9bfb73

Please sign in to comment.