MCPcopy Create free account
hub / github.com/Ottrlang/otterlang / execute_binary

Function execute_binary

src/cli.rs:931–952  ·  view source on GitHub ↗
(path: &Path, settings: &CompilationSettings)

Source from the content-addressed store, hash-verified

929}
930
931fn execute_binary(path: &Path, settings: &CompilationSettings) -> Result<()> {
932 if settings.debug {
933 println!("Running program: {}", path.display());
934 }
935
936 let mut command = ProcessCommand::new(path);
937 settings.apply_runtime_env(&mut command);
938
939 let status = command
940 .status()
941 .with_context(|| format!("failed to execute {}", path.display()))?;
942
943 if !status.success() {
944 if settings.debug {
945 eprintln!("\nStack trace:");
946 eprintln!(" Exit status: {}", status);
947 }
948 bail!("program exited with status {status}");
949 }
950
951 Ok(())
952}
953
954fn run_program_with_jit(
955 program: &otterc_ast::nodes::Program,

Callers 1

handle_runFunction · 0.85

Calls 1

apply_runtime_envMethod · 0.80

Tested by

no test coverage detected