1
0
Fork 0
mirror of https://github.com/lise-henry/crowbook synced 2024-05-28 18:16:32 +02:00

fixed a bug which caused error when crowbook runned on book in same directory

This commit is contained in:
Elisabeth Henry 2016-02-20 00:10:31 +01:00
parent 4725b0b7a6
commit 91d99ca9a6

View File

@ -102,9 +102,11 @@ impl Book {
// change current directory
if let Some(parent) = path.parent() {
if !env::set_current_dir(&parent).is_ok() {
return Err(Error::ConfigParser("could not change current directory to the one of the config file",
format!("{}", parent.display())));
if !parent.to_string_lossy().is_empty() {
if !env::set_current_dir(&parent).is_ok() {
return Err(Error::ConfigParser("could not change current directory to the one of the config file",
format!("{}", parent.display())));
}
}
}