summaryrefslogtreecommitdiff
path: root/crates/typst-cli/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-cli/src/main.rs')
-rw-r--r--crates/typst-cli/src/main.rs17
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"
+ )
+ }
+}