lux_cli/generate_lockfile.rs
1use lux_lib::{config::Config, operations, workspace::Workspace};
2use miette::Result;
3
4/// Generate a lockfile for the current project without installing its dependencies.
5pub async fn generate_lockfile(config: Config) -> Result<()> {
6 let workspace = Workspace::current_or_err()?;
7
8 operations::GenerateLockfile::new(&config, &workspace)
9 .generate()
10 .await?;
11
12 println!("Generated {}", workspace.lockfile_path().display());
13
14 Ok(())
15}