Skip to content

Commit

Permalink
#56
Browse files Browse the repository at this point in the history
  • Loading branch information
baoyachi committed Jun 28, 2021
1 parent 0c954d9 commit ba23143
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shadow-rs"
version = "0.6.0"
version = "0.6.2"
authors = ["baoyachi <[email protected]>"]
edition = "2018"
description = "A build-time information stored in your rust project"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ with [`clap`](https://github.com/baoyachi/shadow-rs/blob/master/example_shadow/s
| PROJECT_NAME | shadow-rs |
| BUILD_TIME | 2021-06-24 21:33:59 |
| BUILD_TIME_2822 | Thu, 24 Jun 2021 21:33:59 +0800 |
| BUILD_TIME_3339 | 2021-06-24T21:33:59.972494+08:00 |
| BUILD_TIME_3339 | 2021-06-24T15:53:55+08:00 |
| BUILD_RUST_CHANNEL | debug/release |

If you have any questions, please create an [issue](https://github.com/baoyachi/shadow-rs/issues/new) so we may improve
Expand Down
4 changes: 2 additions & 2 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::build::*;
use crate::channel::*;
use crate::err::SdResult;

use chrono::Local;
use chrono::{Local, SecondsFormat};
use std::env;
use std::process::Command;

Expand Down Expand Up @@ -272,7 +272,7 @@ pub fn build_time(project: &mut Project) {
BUILD_TIME_3339,
ConstVal {
desc: "display project build time by rfc3399".to_string(),
v: time.to_rfc3339(),
v: time.to_rfc3339_opts(SecondsFormat::Secs, true),
t: ConstType::Str,
},
);
Expand Down
6 changes: 5 additions & 1 deletion src/git.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::build::{ConstType, ConstVal, ShadowConst};
use crate::ci::CiType;
use crate::err::*;
use chrono::SecondsFormat;
use std::collections::HashMap;
use std::path::Path;
use std::process::Command;
Expand Down Expand Up @@ -95,7 +96,10 @@ impl Git {

self.update_val(COMMIT_DATE_2822, date_time.to_rfc2822());

self.update_val(COMMIT_DATE_3339, date_time.to_rfc3339());
self.update_val(
COMMIT_DATE_3339,
date_time.to_rfc3339_opts(SecondsFormat::Secs, true),
);

let author = commit.author();
if let Some(v) = author.email() {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
//! pub const COMMIT_AUTHOR :&str = "baoyachi";
//! pub const BUILD_TIME :&str = "2020-08-16 13:48:52";
//! pub const BUILD_TIME_2822 :&str = "Thu, 24 Jun 2021 21:44:14 +0800";
//! pub const BUILD_TIME_3339 :&str = "2021-06-24T21:44:14.473058+08:00";
//! pub const BUILD_TIME_3339 :&str = "2021-06-24T15:53:55+08:00";
//! pub const COMMIT_DATE :&str = "2020-08-16 13:12:52";
//! pub const COMMIT_DATE_2822 :&str = "Thu, 24 Jun 2021 21:44:14 +0800";
//! pub const COMMIT_DATE_3339 :&str = "2021-06-24T21:44:14.473058+08:00";
Expand Down

0 comments on commit ba23143

Please sign in to comment.