...
This commit is contained in:
@@ -41,6 +41,8 @@ pub fn register_bah_module(engine: &mut Engine) -> Result<(), Box<EvalAltResult>
|
||||
engine.register_fn("image_push", builder_image_push);
|
||||
engine.register_fn("image_tag", builder_image_tag);
|
||||
engine.register_fn("build", builder_build);
|
||||
engine.register_fn("write_content", builder_write_content);
|
||||
engine.register_fn("read_content", builder_read_content);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -146,6 +148,16 @@ pub fn builder_config(builder: &mut Builder, options: Map) -> Result<CommandResu
|
||||
bah_error_to_rhai_error(builder.config(config_options))
|
||||
}
|
||||
|
||||
/// Write content to a file in the container
|
||||
pub fn builder_write_content(builder: &mut Builder, content: &str, dest_path: &str) -> Result<CommandResult, Box<EvalAltResult>> {
|
||||
bah_error_to_rhai_error(builder.write_content(content, dest_path))
|
||||
}
|
||||
|
||||
/// Read content from a file in the container
|
||||
pub fn builder_read_content(builder: &mut Builder, source_path: &str) -> Result<String, Box<EvalAltResult>> {
|
||||
bah_error_to_rhai_error(builder.read_content(source_path))
|
||||
}
|
||||
|
||||
// Builder static methods
|
||||
pub fn builder_images(_builder: &mut Builder) -> Result<Array, Box<EvalAltResult>> {
|
||||
let images = bah_error_to_rhai_error(Builder::images())?;
|
||||
|
Reference in New Issue
Block a user