diff options
| author | tingerrr <me@tinger.dev> | 2024-08-05 20:49:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-05 18:49:02 +0000 |
| commit | 672f6e5f97c2bdcd3e94754c9486869bf7b8de56 (patch) | |
| tree | 14dc74c6f841f69e7e820240af84b41f7c32b52b /crates/typst-cli/src/init.rs | |
| parent | 810491c9d31b614a435020f888fbd380e8e039a1 (diff) | |
Add typst-kit crate (#4540)
Diffstat (limited to 'crates/typst-cli/src/init.rs')
| -rw-r--r-- | crates/typst-cli/src/init.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/typst-cli/src/init.rs b/crates/typst-cli/src/init.rs index cb6b6627..842419fc 100644 --- a/crates/typst-cli/src/init.rs +++ b/crates/typst-cli/src/init.rs @@ -10,11 +10,12 @@ use typst::syntax::package::{ }; use crate::args::InitCommand; -use crate::package::PackageStorage; +use crate::download::PrintDownload; +use crate::package; /// Execute an initialization command. pub fn init(command: &InitCommand) -> StrResult<()> { - let package_storage = PackageStorage::from_args(&command.package_storage_args); + let package_storage = package::storage(&command.package_storage_args); // Parse the package specification. If the user didn't specify the version, // we try to figure it out automatically by downloading the package index @@ -28,7 +29,8 @@ pub fn init(command: &InitCommand) -> StrResult<()> { })?; // Find or download the package. - let package_path = package_storage.prepare_package(&spec)?; + let package_path = + package_storage.prepare_package(&spec, &mut PrintDownload(&spec))?; // Parse the manifest. let manifest = parse_manifest(&package_path)?; |
