Skip to main content

build_pack

Function build_pack 

Source
pub fn build_pack<P: AsRef<Path>, Q: AsRef<Path>>(
    input_dir: P,
    output_file: Q,
) -> Result<()>
Expand description

Build a .ccpack file from a directory

§Arguments

  • input_dir - Path to the directory containing pack.toml, cards/, scripts/, etc.
  • output_file - Path where the .ccpack file will be written

§Returns

Result indicating success or detailed error

§Process

  1. Validate that pack.toml exists and parse it
  2. Walk directory and collect all valid files (sorted)
  3. Compute SHA-256 for each file
  4. Generate manifest.toml
  5. Create tar archive with all files + manifest
  6. Compress with zstd