Skip to main content

ShellEnvironment

Trait ShellEnvironment 

Source
pub trait ShellEnvironment: Send + Sync {
    // Required methods
    fn shell_exec(&self, script: &str) -> Result<()>;
    fn shell_exec_stdout(&self, script: &str) -> Result<String>;
    fn shell_exec_visible(&self, script: &str) -> Result<()>;
    fn log_info(&self, msg: &str);
    fn log_success(&self, msg: &str);

    // Provided methods
    fn log_warn(&self, _msg: &str) { ... }
    fn shell_exec_capture(&self, script: &str) -> Result<(String, String)> { ... }
}
Expand description

Minimal shell execution abstraction used by dev-mode builds.

This trait provides just shell execution and logging — enough for dev_build() which runs nix build directly in the Lima VM.

Required Methods§

Source

fn shell_exec(&self, script: &str) -> Result<()>

Execute a shell script in the VM.

Source

fn shell_exec_stdout(&self, script: &str) -> Result<String>

Execute a shell script in the VM and capture stdout.

Source

fn shell_exec_visible(&self, script: &str) -> Result<()>

Execute a shell script with visible output.

Source

fn log_info(&self, msg: &str)

Log an informational message.

Source

fn log_success(&self, msg: &str)

Log a success message.

Provided Methods§

Source

fn log_warn(&self, _msg: &str)

Log a warning (optional; default no-op for test fakes).

Source

fn shell_exec_capture(&self, script: &str) -> Result<(String, String)>

Execute a shell script, capturing both stdout and stderr.

Returns (stdout, stderr) on success. On failure, returns the exit code and captured stderr in the error. Used by the build pipeline to capture nix build errors for structured reporting.

Default: falls back to shell_exec_stdout (stderr not captured).

Implementors§