1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Shell execution in sandbox.
//!
//! Execute shell scripts with simple, fluent API.
//!
//! ## Example
//!
//! ```ignore
//! use evalbox::shell;
//!
//! // Simple execution
//! let output = shell::run("echo hello")?;
//! assert_eq!(output.stdout_str().trim(), "hello");
//!
//! // With options
//! let output = shell::run("cat /data/file")
//! .with("/host/data", "/data")
//! .timeout(Duration::from_secs(10))?;
//!
//! // With network access
//! let output = shell::run("curl https://example.com")
//! .network(true)?;
//! ```
pub use ShellBuilder;
use crateResult;
use crateOutput;
/// Run a shell script with default settings.
///
/// Returns a `ShellBuilder` that can be customized with `.timeout()`, `.network()`, etc.
/// The builder implements `Try` so using `?` will execute and return the result.
///
/// # Example
///
/// ```ignore
/// // Simple execution
/// let output = shell::run("echo hello")?;
///
/// // With options
/// let output = shell::run("echo hello")
/// .timeout(Duration::from_secs(5))
/// .network(true)?;
/// ```
/// Run a shell script and wait for completion (blocking).
///
/// This is a convenience function that immediately executes the script.