File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1- use crate :: utils:: display_link;
1+ use crate :: { confirm_prompt , fail , utils:: display_link} ;
22use colored:: Colorize ;
3+ use futures:: future:: UnitError ;
34use std:: {
45 path:: { Path , PathBuf } ,
56 process:: Output ,
@@ -56,8 +57,13 @@ pub fn get_git_root() -> anyhow::Result<PathBuf> {
5657 get_git_output ( root, & args) . map ( |output| output. into ( ) )
5758}
5859
59- pub static GIT_ROOT : Lazy < PathBuf > =
60- Lazy :: new ( || get_git_root ( ) . expect ( "Failed to determine Git root directory" ) ) ;
60+ pub static GIT_ROOT : Lazy < PathBuf > = Lazy :: new ( || match get_git_root ( ) {
61+ Ok ( root) => root,
62+ Err ( err) => {
63+ fail ! ( "Failed to determine Git root directory.\n {err}" ) ;
64+ std:: process:: exit ( 1 )
65+ }
66+ } ) ;
6167
6268type Git = Lazy < Box < dyn Fn ( & [ & str ] ) -> Result < String > + Send + Sync > > ;
6369
You can’t perform that action at this time.
0 commit comments