aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/self_update.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-05 12:20:32 +0900
committernsfisis <nsfisis@gmail.com>2026-05-05 12:55:09 +0900
commita55ad1cc44c12836eca5652d231902968e04eea1 (patch)
tree3e24d859a464dd716ecb92cc40c729bf281863f4 /crates/mozart/src/commands/self_update.rs
parent14d3eb2b2f537140bf626b3d109e01834704e5bf (diff)
downloadphp-mozart-a55ad1cc44c12836eca5652d231902968e04eea1.tar.gz
php-mozart-a55ad1cc44c12836eca5652d231902968e04eea1.tar.zst
php-mozart-a55ad1cc44c12836eca5652d231902968e04eea1.zip
refactor(core): centralize version constant in mozart-core
Diffstat (limited to 'crates/mozart/src/commands/self_update.rs')
-rw-r--r--crates/mozart/src/commands/self_update.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/mozart/src/commands/self_update.rs b/crates/mozart/src/commands/self_update.rs
index 2c7c59b..401d15a 100644
--- a/crates/mozart/src/commands/self_update.rs
+++ b/crates/mozart/src/commands/self_update.rs
@@ -1,4 +1,5 @@
use clap::Args;
+use mozart_core::MOZART_VERSION;
use mozart_core::console::Verbosity;
use mozart_core::console_format;
use std::io::Write;
@@ -91,12 +92,6 @@ fn get_data_dir() -> anyhow::Result<PathBuf> {
.join("mozart"))
}
-// ─── Version helpers ──────────────────────────────────────────────────────────
-
-fn get_current_version() -> &'static str {
- env!("CARGO_PKG_VERSION")
-}
-
/// Returns the platform-specific binary asset name for the current build target.
///
/// Examples: `mozart-linux-x86_64`, `mozart-macos-aarch64`, `mozart-windows-x86_64.exe`
@@ -286,7 +281,7 @@ async fn update(
data_dir: &Path,
console: &mozart_core::console::Console,
) -> anyhow::Result<()> {
- let current_version = get_current_version();
+ let current_version = MOZART_VERSION;
let channel = effective_channel(args.preview);
// Fetch releases