Skip to main content

pack_dir_with_target

Function pack_dir_with_target 

Source
pub fn pack_dir_with_target(
    src_dir: &Path,
    output_dir: &Path,
    target_triple: &str,
) -> Result<PathBuf>
Expand description

Create a .tar.gz artifact with RFC-0003 compliant naming.

The artifact will be named: <plugin-name>-v<version>-<target-triple>.tar.gz

§Arguments

  • src_dir - Source directory containing plugin files
  • output_dir - Directory to write the artifact to
  • target_triple - Target triple (e.g., “x86_64-unknown-linux-gnu”)

§Returns

  • Path to the checksum file on success

§Example

use plugin_packager::pack_dir_with_target;
use std::path::Path;

let checksum = pack_dir_with_target(
    Path::new("./my-plugin"),
    Path::new("./dist"),
    "x86_64-unknown-linux-gnu"
).unwrap();
// Creates: ./dist/my-plugin-v1.0.0-x86_64-unknown-linux-gnu.tar.gz