typst-cli 0.15.0-rc.1

The command line interface for Typst.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use typst_kit::packages::{FsPackages, SystemPackages, UniversePackages};

use crate::args::PackageArgs;

/// Returns a new package storage for the given args.
pub fn system(args: &PackageArgs) -> SystemPackages {
    SystemPackages::from_parts(
        args.package_path
            .clone()
            .map(FsPackages::new)
            .or_else(FsPackages::system_data),
        args.package_cache_path
            .clone()
            .map(FsPackages::new)
            .or_else(FsPackages::system_cache),
        UniversePackages::new(crate::download::downloader()),
    )
}