Print error and exit if Maildir path config is wrong
parent
bc7da4610e
commit
22f11445e2
|
@ -496,6 +496,18 @@ impl MaildirType {
|
|||
folders: &mut FnvHashMap<FolderHash, MaildirFolder>,
|
||||
p: P,
|
||||
) -> Vec<FolderHash> {
|
||||
if !p.as_ref().exists() || !p.as_ref().is_dir() {
|
||||
eprintln!(
|
||||
"Configuration error: Path \"{}\" {}",
|
||||
p.as_ref().display(),
|
||||
if !p.as_ref().exists() {
|
||||
"does not exist."
|
||||
} else {
|
||||
"is not a directory."
|
||||
}
|
||||
);
|
||||
std::process::exit(1);
|
||||
}
|
||||
let mut children = Vec::new();
|
||||
for mut f in fs::read_dir(p).unwrap() {
|
||||
'entries: for f in f.iter_mut() {
|
||||
|
|
|
@ -168,11 +168,8 @@ impl State {
|
|||
* stdin, see get_events() for details
|
||||
* */
|
||||
let input_thread = chan::r#async();
|
||||
let _stdout = std::io::stdout();
|
||||
_stdout.lock();
|
||||
let backends = Backends::new();
|
||||
let settings = Settings::new();
|
||||
let stdout = AlternateScreen::from(_stdout.into_raw_mode().unwrap());
|
||||
|
||||
let termsize = termion::terminal_size().ok();
|
||||
let termcols = termsize.map(|(w, _)| w);
|
||||
|
@ -195,6 +192,11 @@ impl State {
|
|||
})
|
||||
.collect();
|
||||
accounts.sort_by(|a, b| a.name().cmp(&b.name()));
|
||||
|
||||
let _stdout = std::io::stdout();
|
||||
_stdout.lock();
|
||||
let stdout = AlternateScreen::from(_stdout.into_raw_mode().unwrap());
|
||||
|
||||
let mut s = State {
|
||||
cols,
|
||||
rows,
|
||||
|
|
Loading…
Reference in New Issue