We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f082ec commit a08df69Copy full SHA for a08df69
src/git_commands.rs
@@ -1,5 +1,6 @@
1
-use crate::utils::display_link;
+use crate::{confirm_prompt, fail, utils::display_link};
2
use colored::Colorize;
3
+use futures::future::UnitError;
4
use std::{
5
path::{Path, PathBuf},
6
process::Output,
@@ -56,8 +57,13 @@ pub fn get_git_root() -> anyhow::Result<PathBuf> {
56
57
get_git_output(root, &args).map(|output| output.into())
58
}
59
-pub static GIT_ROOT: Lazy<PathBuf> =
60
- Lazy::new(|| get_git_root().expect("Failed to determine Git root directory"));
+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
+});
67
68
type Git = Lazy<Box<dyn Fn(&[&str]) -> Result<String> + Send + Sync>>;
69
0 commit comments