Skip to content

Commit 54a55c4

Browse files
committed
Rename get git last commit message example
1 parent 8207c28 commit 54a55c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: examples/basic_execute_shell_command.rs renamed to examples/exec_command_get_git_last_commit_info_before_compile.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
1414
.output()?;
1515
let last_commit_str = String::from_utf8(cmd_res.stdout)?;
1616
let last_commit: CommitInfo = toml::de::from_str(&last_commit_str)?;
17-
dbg!(last_commit);
17+
dbg!(&last_commit);
18+
// if in build.rs, emit git_last_commit_info to compile time and retired use env! as const &st
19+
// println!("cargo:rustc-env={}={}", "LAST_COMMIT_HASH", last_commit.hash);
20+
// println!("cargo:rustc-env={}={}", "LAST_COMMIT_DATE", last_commit.date);
21+
// println!("cargo:rustc-env={}={}", "LAST_COMMIT_MESSAGE", last_commit.message);
1822
Ok(())
1923
}

0 commit comments

Comments
 (0)