Skip to main content

grex_cli/cli/verbs/
update.rs

1//! `grex update` — refresh + re-install across packs.
2//!
3//! v1.4.0 ships `update` as a thin alias of `sync` because the existing
4//! sync pipeline already re-runs install actions on lockfile delta
5//! (`grex_core::sync::run`). The alias keeps the verb discoverable in
6//! `--help` and reserves a dedicated dispatch slot for v2 if pull-then-
7//! install ever needs distinct lifecycle hooks.
8
9use crate::cli::args::{GlobalFlags, SyncArgs, UpdateArgs};
10use anyhow::Result;
11use tokio_util::sync::CancellationToken;
12
13pub fn run(args: UpdateArgs, global: &GlobalFlags, cancel: &CancellationToken) -> Result<()> {
14    let sync_args = SyncArgs {
15        recursive: true,
16        pack_root: args.pack.as_ref().map(std::path::PathBuf::from),
17        pack: None,
18        dry_run: false,
19        quiet: false,
20        no_validate: false,
21        ref_override: None,
22        only: Vec::new(),
23        force: false,
24        force_prune: false,
25        force_prune_with_ignored: false,
26        quarantine: false,
27        parallel: None,
28        retain_days: None,
29    };
30    super::sync::run(sync_args, global, cancel)
31}