File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,15 @@ use std::{env, process};
33use chrono:: { TimeZone as _, Utc } ;
44use rustc_version:: { Channel , version_meta} ;
55
6+ fn git_revision_hash ( ) -> Option < String > {
7+ let result = process:: Command :: new ( "git" )
8+ . args ( [ "rev-parse" , "--short=10" , "HEAD" ] )
9+ . output ( ) ;
10+ let output = result. ok ( ) ?;
11+ let v = String :: from ( String :: from_utf8_lossy ( & output. stdout ) . trim ( ) ) ;
12+ if v. is_empty ( ) { None } else { Some ( v) }
13+ }
14+
615fn main ( ) {
716 println ! ( "cargo::rustc-check-cfg=cfg(allow_unknown_lints)" ) ;
817 println ! ( "cargo::rustc-check-cfg=cfg(include_nightly_lints)" ) ;
@@ -26,12 +35,3 @@ fn main() {
2635 } ;
2736 println ! ( "cargo:rustc-env=GIRT_BUILD_DATE={}" , build_date. format( "%Y-%m-%d" ) ) ;
2837}
29-
30- fn git_revision_hash ( ) -> Option < String > {
31- let result = process:: Command :: new ( "git" )
32- . args ( [ "rev-parse" , "--short=10" , "HEAD" ] )
33- . output ( ) ;
34- let output = result. ok ( ) ?;
35- let v = String :: from ( String :: from_utf8_lossy ( & output. stdout ) . trim ( ) ) ;
36- if v. is_empty ( ) { None } else { Some ( v) }
37- }
You can’t perform that action at this time.
0 commit comments