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:
parent
4725b0b7a6
commit
91d99ca9a6
|
@ -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())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue