mirror of https://github.com/stelzo/typst.git
parent
72fb155403
commit
f04b6ebc1a
|
|
@ -189,7 +189,13 @@ fn dispatch(command: Command) -> StrResult<()> {
|
||||||
fn compile(command: CompileCommand) -> StrResult<()> {
|
fn compile(command: CompileCommand) -> StrResult<()> {
|
||||||
let root = if let Some(root) = &command.root {
|
let root = if let Some(root) = &command.root {
|
||||||
root.clone()
|
root.clone()
|
||||||
} else if let Some(dir) = command.input.parent() {
|
} else if let Some(dir) = command
|
||||||
|
.input
|
||||||
|
.canonicalize()
|
||||||
|
.ok()
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|path| path.parent())
|
||||||
|
{
|
||||||
dir.into()
|
dir.into()
|
||||||
} else {
|
} else {
|
||||||
PathBuf::new()
|
PathBuf::new()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue