Skip to main content

zoi_cli/cmd/package/
bundle.rs

1use anyhow::Result;
2use clap::Parser;
3use std::path::PathBuf;
4
5#[derive(Parser, Debug)]
6pub struct BundleCommand {
7    /// Path to the package file (e.g. path/to/name.pkg.lua)
8    #[arg(required = true)]
9    pub package_file: PathBuf,
10
11    /// Directory to output the bundled package to
12    #[arg(long, short = 'o')]
13    pub output_dir: Option<PathBuf>,
14
15    /// Sign the bundle with a PGP key
16    #[arg(long)]
17    pub sign: Option<String>,
18
19    /// Override the package version
20    #[arg(long)]
21    pub version_override: Option<String>,
22
23    /// The build type to bundle (e.g. 'source', 'pre-compiled')
24    #[arg(long, short = 't')]
25    pub build_type: Option<String>,
26}
27
28pub fn run(args: BundleCommand) -> Result<()> {
29    crate::pkg::package::bundle::run(
30        &args.package_file,
31        args.output_dir.as_deref(),
32        args.sign,
33        args.version_override.as_deref(),
34        args.build_type,
35    )
36}