File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ use std::io::Write;
77use std:: process:: Command ;
88use std:: time:: Instant ;
99
10+ use anki_process:: CommandExt ;
11+ use anyhow:: Context ;
1012use camino:: Utf8Path ;
1113use camino:: Utf8PathBuf ;
1214use clap:: Args ;
@@ -162,11 +164,12 @@ fn maybe_update_buildhash(build_root: &Utf8Path) {
162164fn get_buildhash ( ) -> String {
163165 let output = Command :: new ( "git" )
164166 . args ( [ "rev-parse" , "--short=8" , "HEAD" ] )
165- . output ( )
166- . expect ( "git" ) ;
167- assert ! ( output. status. success( ) ,
168- "Invoking 'git' failed. Make sure you're building from a clone of the git repo, and that 'git' is installed." ) ;
169- String :: from_utf8 ( output. stdout ) . unwrap ( ) . trim ( ) . into ( )
167+ . utf8_output ( )
168+ . context (
169+ "Make sure you're building from a clone of the git repo, and that 'git' is installed." ,
170+ )
171+ . unwrap ( ) ;
172+ output. stdout . trim ( ) . into ( )
170173}
171174
172175fn write_if_changed ( path : & Utf8Path , contents : & str ) {
You can’t perform that action at this time.
0 commit comments