mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
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…
x
Reference in New Issue
Block a user