This commit is contained in:
2025-04-04 18:21:16 +02:00
parent eca7e6f552
commit c9b4010089
18 changed files with 1018 additions and 45 deletions

View File

@@ -6,15 +6,49 @@
mod error;
mod os;
mod process;
mod buildah;
#[cfg(test)]
mod tests;
use rhai::Engine;
// Re-export common Rhai types for convenience
pub use rhai::{Array, Dynamic, Map, EvalAltResult, Engine};
// Re-export error module
pub use error::*;
pub use os::*;
pub use process::*;
// Re-export specific functions from modules to avoid name conflicts
pub use os::{
register_os_module,
// File system functions
exist, find_file, find_files, find_dir, find_dirs,
delete, mkdir, file_size, rsync,
// Download functions
download, download_install
};
pub use process::{
register_process_module,
// Run functions
run_command, run_silent, run_with_options, new_run_options,
// Process management functions
which, kill, process_list, process_get
};
pub use buildah::{
register_buildah_module,
// Container functions
from, run, run_with_isolation, add, commit, remove, list,
build_with_options, new_build_options,
// Image functions
images, image_remove, image_push, image_tag, image_pull,
image_commit_with_options, new_commit_options,
config_with_options, new_config_options
};
// Rename copy functions to avoid conflicts
pub use os::copy as os_copy;
pub use buildah::copy as buildah_copy;
/// Register all SAL modules with the Rhai engine
///
@@ -41,6 +75,9 @@ pub fn register(engine: &mut Engine) -> Result<(), Box<rhai::EvalAltResult>> {
// Register Process module functions
process::register_process_module(engine)?;
// Register Buildah module functions
buildah::register_buildah_module(engine)?;
// Future modules can be registered here
Ok(())