Commit 3bdf61e 1 parent b189820 commit 3bdf61e Copy full SHA for 3bdf61e
File tree 1 file changed +8
-5
lines changed
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;
7
7
use std:: process:: Command ;
8
8
use std:: time:: Instant ;
9
9
10
+ use anki_process:: CommandExt ;
11
+ use anyhow:: Context ;
10
12
use camino:: Utf8Path ;
11
13
use camino:: Utf8PathBuf ;
12
14
use clap:: Args ;
@@ -162,11 +164,12 @@ fn maybe_update_buildhash(build_root: &Utf8Path) {
162
164
fn get_buildhash ( ) -> String {
163
165
let output = Command :: new ( "git" )
164
166
. 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 ( )
170
173
}
171
174
172
175
fn write_if_changed ( path : & Utf8Path , contents : & str ) {
You can’t perform that action at this time.
0 commit comments