use src key in book.json when given
This commit is contained in:
parent
cf35e08abc
commit
a9e5dc63f1
|
@ -70,7 +70,7 @@ impl BookConfig {
|
|||
self.description = a.to_string().replace("\"", "")
|
||||
}
|
||||
|
||||
// Destination
|
||||
// Destination folder
|
||||
if let Some(a) = config.get("dest") {
|
||||
let dest = PathBuf::from(&a.to_string().replace("\"", ""));
|
||||
|
||||
|
@ -85,6 +85,20 @@ impl BookConfig {
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Source folder
|
||||
if let Some(a) = config.get("src") {
|
||||
let src = PathBuf::from(&a.to_string().replace("\"", ""));
|
||||
match src.is_relative() {
|
||||
true => {
|
||||
let src = self.get_root().join(&src).to_owned();
|
||||
self.set_src(&src);
|
||||
},
|
||||
false => {
|
||||
self.set_src(&src);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self
|
||||
|
|
Loading…
Reference in New Issue