diff options
| author | jimvdl <jimvdlind@gmail.com> | 2023-08-26 20:44:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-26 20:44:58 +0200 |
| commit | 7bdf1f57b09ea605045254013a8200373451baf0 (patch) | |
| tree | 0d7264dc2ca3aaf41b31e5226d8562cb4f68121e /crates/typst-cli/src/main.rs | |
| parent | 879182059020e4669efae2296e98cdc8360a3bc2 (diff) | |
Let the CLI `typst update` itself without a package manager (#1887)
Diffstat (limited to 'crates/typst-cli/src/main.rs')
| -rw-r--r-- | crates/typst-cli/src/main.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/typst-cli/src/main.rs b/crates/typst-cli/src/main.rs index 62f14566..b88a0ce4 100644 --- a/crates/typst-cli/src/main.rs +++ b/crates/typst-cli/src/main.rs @@ -4,6 +4,8 @@ mod fonts; mod package; mod query; mod tracing; +#[cfg(feature = "self-update")] +mod update; mod watch; mod world; @@ -39,6 +41,7 @@ fn main() -> ExitCode { Command::Watch(command) => crate::watch::watch(command), Command::Query(command) => crate::query::query(command), Command::Fonts(command) => crate::fonts::fonts(command), + Command::Update(command) => crate::update::update(command), }; if let Err(msg) = res { @@ -79,3 +82,17 @@ fn color_stream() -> termcolor::StandardStream { fn typst_version() -> &'static str { env!("TYPST_VERSION") } + +#[cfg(not(feature = "self-update"))] +mod update { + use crate::args::UpdateCommand; + use typst::diag::{bail, StrResult}; + + pub fn update(_: UpdateCommand) -> StrResult<()> { + bail!( + "self-updating is not enabled for this executable, \ + please update with the package manager or mechanism \ + used for initial installation" + ) + } +} |
