mirror of
https://github.com/typst/typst
synced 2025-05-17 02:25:27 +08:00
Produce output file in current directory instead of source directory 📂
This commit is contained in:
parent
ee38c6aa9a
commit
e26b431bee
@ -22,7 +22,10 @@ fn main() {
|
|||||||
|
|
||||||
let src_path = Path::new(&args[1]);
|
let src_path = Path::new(&args[1]);
|
||||||
let dest_path = if args.len() <= 2 {
|
let dest_path = if args.len() <= 2 {
|
||||||
src_path.with_extension("pdf")
|
let name = src_path
|
||||||
|
.file_name()
|
||||||
|
.expect("source path is not a file");
|
||||||
|
Path::new(name).with_extension("pdf")
|
||||||
} else {
|
} else {
|
||||||
PathBuf::from(&args[2])
|
PathBuf::from(&args[2])
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user