mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-09 05:58:55 +00:00
add error message when running from a non-existent directory
This commit is contained in:
parent
440a7a8f0e
commit
32fef364ef
1 changed files with 6 additions and 1 deletions
|
@ -2664,7 +2664,12 @@ impl CliRunner {
|
|||
ui: &mut Ui,
|
||||
mut layered_configs: LayeredConfigs,
|
||||
) -> Result<(), CommandError> {
|
||||
let cwd = env::current_dir().unwrap(); // TODO: maybe map_err to CommandError?
|
||||
let cwd = env::current_dir().map_err(|_| {
|
||||
user_error_with_hint(
|
||||
"Could not determine current directory",
|
||||
"Did you check-out a commit where the directory doesn't exist?",
|
||||
)
|
||||
})?;
|
||||
layered_configs.read_user_config()?;
|
||||
let config = layered_configs.merge();
|
||||
ui.reset(&config)?;
|
||||
|
|
Loading…
Reference in a new issue